summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-6/+6
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* [Tooling] Reuse FileManager in ASTUnit.Benjamin Kramer2015-10-061-13/+9
| | | | | | | | ASTUnit was creating multiple FileManagers and throwing them away. Reuse the one from Tooling. No functionality change now but necessary for VFSifying tooling. llvm-svn: 249410
* Add a -gmodules option to the driver and a -dwarf-ext-refs to cc1Adrian Prantl2015-08-271-5/+5
| | | | | | | | | | | | | to enable the use of external type references in the debug info (a.k.a. module debugging). The driver expands -gmodules to "-g -fmodule-format=obj -dwarf-ext-refs" and passes that to cc1. All this does at the moment is set a flag codegenopts. http://reviews.llvm.org/D11958 llvm-svn: 246192
* [Modules] Wrap the main ModuleManager visitor in a function_ref.Benjamin Kramer2015-07-251-29/+19
| | | | | | | Avoids the awkward passing of an opaque void *UserData argument. No functional change intended. llvm-svn: 243213
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-171-3/+3
| | | | | | | | | | | | | - 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
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-071-3/+4
| | | | | | rdar://19369529 llvm-svn: 241557
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-3/+3
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-3/+3
| | | | | | | | | | | | 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
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-201-42/+67
| | | | | | | | | | | | | | | | 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
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* Return a pointer instead of having a pointer outparam and a bool return.Rafael Espindola2015-04-101-3/+3
| | | | llvm-svn: 234590
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-3/+3
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* [modules] Teach the AST reader to handle the case of importing a moduleChandler Carruth2015-03-141-2/+2
| | | | | | | | | | | | | | | | | | | with a subset of the existing target CPU features or mismatched CPU names. While we can't check that the CPU name used to build the module will end up being able to codegen correctly for the translation unit, we actually check that the imported features are a subset of the existing features. While here, rewrite the code to use std::set_difference and have it diagnose all of the differences found. Test case added which walks the set relationships and ensures we diagnose all the right cases and accept the others. No functional change for implicit modules here, just better diagnostics. llvm-svn: 232248
* [ASTUnit] Fix crash when trying to load a module file via ↵Argyrios Kyrtzidis2015-03-031-5/+7
| | | | | | | | ASTUnit::LoadFromASTFile. rdar://19997358 llvm-svn: 231060
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-16/+2
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-2/+16
| | | | | | | | | | | | | | | | | 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
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-241-16/+2
| | | | | | | This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. llvm-svn: 230309
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-241-2/+16
| | | | | | | | | | | | | | 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
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-211-16/+2
| | | | | | | | This reverts commit 230099. The Linux configure+make build variant still needs some work. llvm-svn: 230103
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-2/+16
| | | | | | | | | | | | | | 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
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-16/+2
| | | | | | | | This reverts commit r230067. Investigating another batch of problems found by the bots. llvm-svn: 230073
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-2/+16
| | | | | | | | | | | | | | 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
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-16/+2
| | | | | | | | | This reverts commit r230044 while dealing with buildbot breakage. Conflicts: test/Modules/module_container.m llvm-svn: 230052
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-2/+16
| | | | | | | | | | | 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
* ASTUnit: Fix a name clash in GCC builds.Benjamin Kramer2015-02-061-2/+2
| | | | | | | Should fix the build. Looks like GCC 4.9 is using different scoping rules for range-based for loops. llvm-svn: 228424
* ASTUnit: Use range-based for loops.Benjamin Kramer2015-02-061-91/+69
| | | | llvm-svn: 228420
* Update APIs that return a pair of iterators to return an iterator_range instead.Benjamin Kramer2015-02-061-8/+6
| | | | | | Convert uses of those APIs into ranged for loops. NFC. llvm-svn: 228404
* Make DiagnosticsEngine::takeClient return std::unique_ptr<>Alexander Kornienko2014-11-171-6/+6
| | | | | | | | | | | | | | | | | | Summary: Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated callers to store conditional ownership using a pair of pointer and unique_ptr instead of a pointer + bool. Updated code that temporarily registers clients to use the non-owning registration (+ removed extra calls to takeClient). Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6294 llvm-svn: 222193
* [libclang] Disable spell-checking and warnings during code-completion since ↵Argyrios Kyrtzidis2014-10-311-0/+4
| | | | | | they are not needed. llvm-svn: 220966
* [modules] When a .pcm file is explicitly built separately from the translationRichard Smith2014-10-311-2/+2
| | | | | | unit, allow the -O settings of the two compilations to differ. llvm-svn: 220943
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-261-1/+6
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-221-1/+2
| | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. llvm-svn: 220359
* Frontend: Don't accept null DiagnosticsEngines when building ASTUnitsJustin Bogner2014-10-151-17/+4
| | | | | | | | | | | | | The various ways to create an ASTUnit all take a refcounted pointer to a diagnostics engine as an argument, and if it isn't pointing at anything they initialize it. This is a pretty confusing API, and it really makes more sense for the caller to initialize the thing since they control the lifetime anyway. This fixes the one caller that didn't bother initializing the pointer and asserts that the argument is initialized. llvm-svn: 219752
* Frontend: Remove some unused arguments in ASTUnit (NFC)Justin Bogner2014-10-141-5/+4
| | | | llvm-svn: 219747
* ASTUnit: Replace out parameter with return value, we have NRVO for this.Benjamin Kramer2014-10-031-22/+22
| | | | | | And elide the copy when pushing the return value into a vector. NFC. llvm-svn: 219001
* Unique_ptrify PPCallbacks ownership.Craig Topper2014-09-101-4/+7
| | | | | | Unique_ptr creation stil needs to be moved earlier at some of the call sites. llvm-svn: 217474
* Improve unique_ptr-y ownership in ASTUnit::ComputePreambleDavid Blaikie2014-08-291-47/+29
| | | | | | | | | | | | | | Rather than having a pair of pairs and a reference out parameter, build a structure with everything together and named. A raw pointer and a unique_ptr, rather than a raw pointer and a boolean, are used to communicate ownership transfer. It's possible one day we'll end up with a conditional pointer (probably represented by a raw pointer and a boolean) abstraction to use in places like this. Conditional ownership seems to be coming up more often than I'd hoped... llvm-svn: 216712
* Don't create a null reference in ASTUnit::LoadFromCommandLine.Alexey Samsonov2014-08-281-2/+3
| | | | | | | | | This change is the last in the pack of five commits (also see r216691, r216694, r216695, and r216696) that reduces the number of test failures in "check-clang" invocation in UBSan bootstrap from 2443 down to 5. llvm-svn: 216697
* Update for LLVM api change.Rafael Espindola2014-08-271-9/+6
| | | | llvm-svn: 216585
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-261-5/+5
| | | | llvm-svn: 216478
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-261-1/+1
| | | | llvm-svn: 216476
* Frontend: unique_ptr-ifyDylan Noblesmith2014-08-241-4/+4
| | | | | | NFC. llvm-svn: 216347
* return a std::unique_ptr from getMainBufferWithPrecompiledPreamble. NFC.Rafael Espindola2014-08-181-19/+22
| | | | llvm-svn: 215927
* Simplify ASTUnit::Parse a bit by passing a std::unique_ptr to it.Rafael Espindola2014-08-181-28/+19
| | | | llvm-svn: 215900
* Small cleanup: Don't duplicate default behavior.Rafael Espindola2014-08-131-2/+2
| | | | | | | | std::unique_ptr is null initialized and reset default to null. Thanks to David Blaikie for noticing. llvm-svn: 215560
* Use std::unique_ptr to simplify memory management a bit.Rafael Espindola2014-08-131-12/+6
| | | | llvm-svn: 215559
* Use StringRef instead of MemoryBuffer&.Rafael Espindola2014-08-121-2/+2
| | | | | | | This code doesn't care where the data it is processing comes from, so a StringRef is probably the most natural interface. llvm-svn: 215448
* Change MemoryBuffer* to MemoryBuffer& parameter to Lexer::ComputePreambleDavid Blaikie2014-08-111-4/+4
| | | | | | | | | | | | | (dropping const from the reference as MemoryBuffer is immutable already, so const is just redundant - and while I'd personally put const everywhere, that's not the LLVM Way (see llvm::Type for another example of an immutable type where "const" is omitted for brevity)) Changing the pointer argument to a reference parameter makes call sites identical between callers with unique_ptrs or raw pointers, minimizing the churn in a pending unique_ptr migrations. llvm-svn: 215391
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-101-15/+17
| | | | | | | | 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
OpenPOWER on IntegriCloud