aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ChainedIncludesSource.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-06-29Teach ASTReader how to read only the Preprocessor state from an AST file, ↵Richard Smith1-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. llvm-svn: 306760
2017-01-06Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase ↵David Blaikie1-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. llvm-svn: 291270
2017-01-06Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie1-1/+1
CodeCompleteConsumer" Caused a memory leak reported by asan. Reverting while I investigate. This reverts commit r291184. llvm-svn: 291249
2017-01-05IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie1-1/+1
CodeCompleteConsumer llvm-svn: 291184
2017-01-05Use shared_ptr instead of IntrusiveRefCntPtr for ModuleFileExtensionDavid Blaikie1-1/+1
The intrusiveness wasn't needed here, so this simplifies/clarifies the ownership model. llvm-svn: 291150
2016-08-25Refactor to remove the assumption that we know the name of the module we're ↵Richard Smith1-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). llvm-svn: 279766
2016-07-18[NFC] Header cleanupMehdi Amini1-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 llvm-svn: 275882
2016-07-17Attempt to work around MSVC rejects-valid, round 2.Richard Smith1-2/+5
llvm-svn: 275730
2016-07-17PR28589: attempt to work around MSVC rejects-valid.Richard Smith1-1/+2
llvm-svn: 275727
2016-07-16Reimplement ExternalSemaSource delegation in terms ofRichard Smith1-120/+36
MultiplexExternalSemaSource to remove one of the places that needs updating every time the ExternalSemaSource interface changes. llvm-svn: 275653
2016-07-13[PCH/preamble] Make sure that if the preamble/PCH was serialized with errors ↵Argyrios Kyrtzidis1-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 llvm-svn: 275313
2016-04-08revert SVN r265702, r265640Saleem Abdulrasool1-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. llvm-svn: 265806
2016-04-07Basic: thread CodeGenOptions into TargetInfoSaleem Abdulrasool1-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. llvm-svn: 265640
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