aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ChainedIncludesSource.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-11-03Introduce module file extensions to piggy-back data onto module files.Douglas Gregor1-1/+4
Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. llvm-svn: 251955
2015-08-06Rename the non-coding style conformant functions in namespace BuiltinsEric Christopher1-1/+1
to match the rest of their brethren and reformat the bits that need it. llvm-svn: 244186
2015-08-05function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove itsRichard Smith1-7/+6
useless return value. Switch to using it directly when completing the redeclaration chain for an anonymous declaration, and reduce the set of declarations that we load in the process to just those of the right kind. llvm-svn: 244161
2015-07-17Make the clang module container format selectable from the command line.Adrian Prantl1-1/+1
- introduces a new cc1 option -fmodule-format=[raw,obj] with 'raw' being the default - supports arbitrary module container formats that libclang is agnostic to - adds the format to the module hash to avoid collisions - splits the old PCHContainerOperations into PCHContainerWriter and a PCHContainerReader. Thanks to Richard Smith for reviewing this patch! llvm-svn: 242499
2015-06-22Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko1-1/+1
llvm-svn: 240353
2015-06-22Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-1/+1
The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
2015-06-20Introduce a PCHContainerOperations interface (NFC).Adrian Prantl1-9/+13
A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko1-1/+1
Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
2015-03-24[modules] Deserialize CXXCtorInitializer list for a constructor lazily.Richard Smith1-0/+5
Previously we'd deserialize the list of mem-initializers for a constructor when we deserialized the declaration of the constructor. That could trigger a significant amount of unnecessary work (pulling in all base classes recursively, for a start) and was causing problems for the modules buildbot due to cyclic deserializations. We now deserialize these on demand. This creates a certain amount of duplication with the handling of CXXBaseSpecifiers; I'll look into reducing that next. llvm-svn: 233052
2015-02-25Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl1-10/+6
llvm-svn: 230454
2015-02-25Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl1-6/+10
This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
2015-02-24Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl1-10/+6
This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. llvm-svn: 230309
2015-02-24Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl1-6/+10
This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. Take 3. llvm-svn: 230305
2015-02-21Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl1-10/+6
This reverts commit 230099. The Linux configure+make build variant still needs some work. llvm-svn: 230103
2015-02-20Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl1-6/+10
This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. Take 2. llvm-svn: 230089
2015-02-20Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl1-10/+6
This reverts commit r230067. Investigating another batch of problems found by the bots. llvm-svn: 230073
2015-02-20Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl1-6/+10
This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. llvm-svn: 230067
2015-02-20Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl1-10/+6
This reverts commit r230044 while dealing with buildbot breakage. Conflicts: test/Modules/module_container.m llvm-svn: 230052
2015-02-20Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl1-6/+10
This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 llvm-svn: 230044
2014-08-27Update for LLVM api change.Rafael Espindola1-4/+2
llvm-svn: 216585
2014-08-18Store std::unique_ptr in InMemoryBuffers. NFC.Rafael Espindola1-12/+15
llvm-svn: 215928
2014-08-10Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie1-4/+4
After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215323
2014-07-17Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie1-4/+4
This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213325
2014-07-17unique_ptr-ify ownership of ASTConsumersDavid Blaikie1-4/+4
(after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) llvm-svn: 213307
2014-07-07Move ChainedIncludesSource into the implementationAlp Toker1-4/+50
This doesn't need to be in the headers. llvm-svn: 212451
2014-07-07ChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memoryAlp Toker1-12/+6
Just reference the data instead with shallow MemoryBuffer instances. llvm-svn: 212450
2014-07-06Use non-intrusive refcounting for TargetOptionsAlp Toker1-2/+2
llvm-svn: 212388
2014-07-05Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker1-1/+1
llvm-svn: 212369
2014-05-22[C++11] Use 'nullptr'. Frontend edition.Craig Topper1-11/+11
llvm-svn: 209389
2014-03-07Replace OwningPtr with std::unique_ptr.Ahmed Charles1-4/+4
This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
2014-03-07Change OwningPtr::take() to OwningPtr::release().Ahmed Charles1-4/+4
This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
2014-03-07[Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is ↵Argyrios Kyrtzidis1-1/+1
TU_Prefix avoid warning for unused macros. rdar://15034698 llvm-svn: 203213
2014-02-27[ASTUnit] Fix use-after-free bug in ↵Argyrios Kyrtzidis1-11/+11
ASTUnit::getMainBufferWithPrecompiledPreamble(). With r197755 we started reading the contents of buffer file entries, but the buffers may point to ASTReader blobs that have been disposed. Fix this by having the CompilerInstance object keep a reference to the ASTReader as well as having the ASTContext keep reference to the ExternalASTSource. This was very difficult to construct a test case for. rdar://16149782 llvm-svn: 202346
2014-02-20Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka1-1/+0
assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
2014-02-19Initial implementation of virtual file systemBen Langmuir1-0/+1
This adds the minimum virtual file system support to start migrating FileManager onto the VFS. Originally discussed here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035188.html Differential Revision: http://llvm-reviews.chandlerc.com/D2745 llvm-svn: 201618
2013-07-05Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper1-3/+3
llvm-svn: 185715
2013-04-26[frontend] Make -chain-include work when used with modules.Argyrios Kyrtzidis1-0/+1
llvm-svn: 180633
2013-03-27[Preprocessor] Remove PPMutationListener.Argyrios Kyrtzidis1-2/+0
It's not used anymore. llvm-svn: 178106
2013-03-19<rdar://problem/13363214> Eliminate race condition between module rebuild ↵Douglas Gregor1-0/+1
and the global module index. The global module index was querying the file manager for each of the module files it knows about at load time, to prune out any out-of-date information. The file manager would then cache the results of the stat() falls used to find that module file. Later, the same translation unit could end up trying to import one of the module files that had previously been ignored by the module cache, but after some other Clang instance rebuilt the module file to bring it up-to-date. The stale stat() results in the file manager would trigger a second rebuild of the already-up-to-date module, causing failures down the line. The global module index now lazily resolves its module file references to actual AST reader module files only after the module file has been loaded, eliminating the stat-caching race. Moreover, the AST reader can communicate to its caller that a module file is missing (rather than simply being out-of-date), allowing us to simplify the module-loading logic and allowing the compiler to recover if a dependent module file ends up getting deleted. llvm-svn: 177367
2013-02-07Simplify FindExternalVisibleDeclsByName by making it return a bool indicatingRichard Smith1-1/+1
if it found any decls, rather than returning a list of found decls. This removes a returning-ArrayRef-to-deleted-storage bug from MultiplexExternalSemaSource (in code not exercised by any of the clang binaries), reduces the work required in the found-no-decls case with PCH, and importantly removes the need for DeclContext::lookup to be reentrant. No functionality change intended! llvm-svn: 174576
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-5/+5
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-11-16Since CreateTargetInfo is taking ownership of the target options, passDouglas Gregor1-1/+1
it as a pointer. llvm-svn: 168136
2012-11-15[modules] Setup the import location of a module file and use itArgyrios Kyrtzidis1-1/+1
as the include location of the main file of an imported module. llvm-svn: 168061
2012-11-09Turn FrontendInputFile into an immutable class and have it also acceptArgyrios Kyrtzidis1-1/+1
a memory buffer instead of only a filename. llvm-svn: 167627
2012-11-09Make CompilerInstance::InitializeSourceManager accept a FrontendInputFile,Argyrios Kyrtzidis1-3/+3
no functionality change. llvm-svn: 167626
2012-10-23Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor1-2/+2
the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
2012-10-22Allow clients of the AST reader to specify what kinds of AST loadDouglas Gregor1-1/+2
failures they know how to tolerate, e.g., out-of-date input files or configuration/version mismatches. Suppress the corresponding diagnostics if the client can handle it. No clients actually use this functionality, yet. llvm-svn: 166449
2012-10-22Distinguish the various kinds of AST file loading failures:Douglas Gregor1-1/+4
file corruption, compiler version mismatch, target/language configuration mismatch, out-of-date AST file. No functionality change yet. llvm-svn: 166446
2012-10-09Rework the (de-)serialization of macros, as stored inDouglas Gregor1-0/+2
MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-1/+1
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536