summaryrefslogtreecommitdiffstats
path: root/lib/Frontend/ChainedIncludesSource.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Teach ASTReader how to read only the Preprocessor state from an AST file, ↵Richard Smith2017-06-291-1/+1
| | | | | | | | | | not the ASTContext state. We use this when running a preprocessor-only action on an AST file in order to avoid paying the runtime cost of loading the extra information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306760 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase ↵David Blaikie2017-01-061-1/+1
| | | | | | | | | | | | | | and CodeCompleteConsumer" Aleksey Shlypanikov pointed out my mistake in migrating an explicit unique_ptr to auto - I was expecting the function returned a unique_ptr, but instead it returned a raw pointer - introducing a leak. Thanks Aleksey! This reapplies r291184, reverted in r291249. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291270 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-061-1/+1
| | | | | | | | | | CodeCompleteConsumer" Caused a memory leak reported by asan. Reverting while I investigate. This reverts commit r291184. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291249 91177308-0d34-0410-b5e6-96231b3b80d8
* IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-051-1/+1
| | | | | | CodeCompleteConsumer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291184 91177308-0d34-0410-b5e6-96231b3b80d8
* Use shared_ptr instead of IntrusiveRefCntPtr for ModuleFileExtensionDavid Blaikie2017-01-051-1/+1
| | | | | | | The intrusiveness wasn't needed here, so this simplifies/clarifies the ownership model. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291150 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor to remove the assumption that we know the name of the module we're ↵Richard Smith2016-08-251-1/+1
| | | | | | emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279766 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Header cleanupMehdi Amini2016-07-181-0/+1
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to work around MSVC rejects-valid, round 2.Richard Smith2016-07-171-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275730 91177308-0d34-0410-b5e6-96231b3b80d8
* PR28589: attempt to work around MSVC rejects-valid.Richard Smith2016-07-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275727 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement ExternalSemaSource delegation in terms ofRichard Smith2016-07-161-120/+36
| | | | | | | | MultiplexExternalSemaSource to remove one of the places that needs updating every time the ExternalSemaSource interface changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275653 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH/preamble] Make sure that if the preamble/PCH was serialized with errors ↵Argyrios Kyrtzidis2016-07-131-1/+1
| | | | | | | | | | that we set diagnostic engine state appropriately. Otherwise there can be a crash with CFG analysis warnings doing work on invalid AST. Fixes crash of rdar://26224134 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275313 91177308-0d34-0410-b5e6-96231b3b80d8
* revert SVN r265702, r265640Saleem Abdulrasool2016-04-081-2/+1
| | | | | | | | | | | Revert the two changes to thread CodeGenOptions into the TargetInfo allocation and to fix the layering violation by moving CodeGenOptions into Basic. Code Generation is arguably not particularly "basic". This addresses Richard's post-commit review comments. This change purely does the mechanical revert and will be followed up with an alternate approach to thread the desired information into TargetInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265806 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic: thread CodeGenOptions into TargetInfoSaleem Abdulrasool2016-04-071-1/+2
| | | | | | | | | This threads CodeGenOptions into the TargetInfo hierarchy. This is motivated by ARM which can change some target information based on the EABI selected (-meabi). Similar options exist for other platforms (e.g. MIPS) and thus is generally useful. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265640 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-031-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251955 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the non-coding style conformant functions in namespace BuiltinsEric Christopher2015-08-061-1/+1
| | | | | | to match the rest of their brethren and reformat the bits that need it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244186 91177308-0d34-0410-b5e6-96231b3b80d8
* function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove itsRichard Smith2015-08-051-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244161 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-171-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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242499 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-201-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240225 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234678 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Deserialize CXXCtorInitializer list for a constructor lazily.Richard Smith2015-03-241-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233052 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-10/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230454 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230423 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-241-10/+6
| | | | | | | This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230309 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-241-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230305 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-211-10/+6
| | | | | | | | This reverts commit 230099. The Linux configure+make build variant still needs some work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230103 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230089 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-10/+6
| | | | | | | | This reverts commit r230067. Investigating another batch of problems found by the bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230073 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230067 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-10/+6
| | | | | | | | | This reverts commit r230044 while dealing with buildbot breakage. Conflicts: test/Modules/module_container.m git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230052 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230044 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM api change.Rafael Espindola2014-08-271-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216585 91177308-0d34-0410-b5e6-96231b3b80d8
* Store std::unique_ptr in InMemoryBuffers. NFC.Rafael Espindola2014-08-181-12/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215928 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-101-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215323 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213325 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ChainedIncludesSource into the implementationAlp Toker2014-07-071-4/+50
| | | | | | This doesn't need to be in the headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212451 91177308-0d34-0410-b5e6-96231b3b80d8
* ChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memoryAlp Toker2014-07-071-12/+6
| | | | | | Just reference the data instead with shallow MemoryBuffer instances. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212450 91177308-0d34-0410-b5e6-96231b3b80d8
* Use non-intrusive refcounting for TargetOptionsAlp Toker2014-07-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212388 91177308-0d34-0410-b5e6-96231b3b80d8
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212369 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Frontend edition.Craig Topper2014-05-221-11/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209389 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-4/+4
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-4/+4
| | | | | | This is a precursor to moving to std::unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203275 91177308-0d34-0410-b5e6-96231b3b80d8
* [Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is ↵Argyrios Kyrtzidis2014-03-071-1/+1
| | | | | | | | | | TU_Prefix avoid warning for unused macros. rdar://15034698 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203213 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTUnit] Fix use-after-free bug in ↵Argyrios Kyrtzidis2014-02-271-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202346 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka2014-02-201-1/+0
| | | | | | | | | | assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201755 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial implementation of virtual file systemBen Langmuir2014-02-191-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201618 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] Make -chain-include work when used with modules.Argyrios Kyrtzidis2013-04-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180633 91177308-0d34-0410-b5e6-96231b3b80d8