summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* unique_ptr-ify CompilerInstance::takeSemaDavid Blaikie2014-08-101-1/+1
| | | | llvm-svn: 215321
* std::unique_ptr-ify the result of ASTUnit::LoadFromASTFileDavid Blaikie2014-08-101-10/+7
| | | | llvm-svn: 215320
* unique_ptr-ify ASTReaderListener in the ASTReaderDavid Blaikie2014-08-101-4/+3
| | | | llvm-svn: 215317
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-17/+15
| | | | | | | | | 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
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-15/+17
| | | | | | | | | (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
* Remove unused sys/stat.h includesAlp Toker2014-07-071-1/+0
| | | | | | The facility was abstracted to LLVM in r187364. llvm-svn: 212441
* Peel away old-style file remapping typedefs and cruftAlp Toker2014-07-071-52/+30
| | | | llvm-svn: 212438
* Use non-intrusive refcounting for TargetOptionsAlp Toker2014-07-061-21/+18
| | | | llvm-svn: 212388
* Use non-intrusive refcounting for LangOptionsAlp Toker2014-07-061-2/+2
| | | | | | | This type is only refcounted in a couple of places so making ownership explicit improves clarity. llvm-svn: 212387
* Constify a read-only parameter and give function a better nameAlp Toker2014-07-061-5/+5
| | | | | | | This makes it clear that TargetInfo doesn't capture the LangOptions object, rather uses it to apply adjustments. llvm-svn: 212386
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-7/+7
| | | | llvm-svn: 212369
* Consider module depedencies when checking a preamble in libclangBen Langmuir2014-06-301-15/+9
| | | | | | | | | | | | | Add module dependencies (header files, module map files) to the list of files to check when deciding whether to rebuild a preamble. That fixes using preambles with module imports so long as they are in non-overridden files. My intent is to use to unify the existing dependency collectors to the new “DependencyCollectory” interface from this commit, starting with the DependencyFileGenerator. llvm-svn: 212060
* Stop sharing the FileManager in ASTUnit::ParseBen Langmuir2014-06-231-1/+7
| | | | | | | | | | We were using old stat values for any files that had previously been looked up, leading to badness. There might be a more elegant solution in invalidating the cache for those file (since we already know which ones they are), but it seems too likely there are existing references to them hiding somewhere. llvm-svn: 211504
* [C++11] Use 'nullptr'. Frontend edition.Craig Topper2014-05-221-65/+65
| | | | llvm-svn: 209389
* Eliminate ASTContext's DelayInitialization flagAlp Toker2014-05-031-8/+3
| | | | | | | | | Having various possible states of initialization following construction doesn't add value here. Also remove the unused size_reserve parameter. llvm-svn: 207897
* Reformat code following Preprocessor constructor updatesAlp Toker2014-05-021-6/+5
| | | | | | Landing this separately to make the previous commits easy to follow at home. llvm-svn: 207826
* Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctorAlp Toker2014-05-021-3/+2
| | | | | | | | The Preprocessor::Initialize() function already offers a clear interface to achieve this, further reducing the confusing number of states a newly constructed preprocessor can have. llvm-svn: 207825
* Remove unused using statement.Nico Weber2014-04-281-1/+0
| | | | llvm-svn: 207427
* Push unique_ptr ownership of ASTUnits further back into their factories.David Blaikie2014-04-251-13/+10
| | | | llvm-svn: 207237
* Attempt to fix null ASTContext in ASTUnit error pathBen Langmuir2014-04-221-1/+4
| | | | | | | | | We don't need the ASTContext for the diagnostics, only the language options, which we can get from the compiler invocation. It worries me how many categorically different states the ASTUnit class can be in depending on how it is being constructed/used. llvm-svn: 206909
* Don't read CompilerInstance fields that don't exist in ASTUnitBen Langmuir2014-04-181-3/+6
| | | | | | | When transferring data from a CompilerInstance in an error path we need to consider cases where the various fields are uninitialized. llvm-svn: 206644
* Honour -ivfsoverlay in ASTUnit to match clangBen Langmuir2014-04-151-8/+27
| | | | | | | This allows code indexing, etc. to use the VFS in the same way as the compiler. llvm-svn: 206309
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-131-41/+41
| | | | | | class. llvm-svn: 203758
* [libclang] Don't pad the main buffer for the preamble.Argyrios Kyrtzidis2014-03-091-40/+6
| | | | | | | | | Padding does not seem to be useful currently, and it leads to bogus location if an error points to the end of the file. rdar://15836513 llvm-svn: 203370
* [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() ↵Aaron Ballman2014-03-081-4/+3
| | | | | | with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203353
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-49/+36
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-071-3/+2
| | | | | | iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-5/+6
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
OpenPOWER on IntegriCloud