summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't use PathV1.h in ASTUnit.cpp.Rafael Espindola2013-06-261-5/+3
| | | | llvm-svn: 184912
* Remove the last use of PathWithStatus.Rafael Espindola2013-06-261-4/+4
| | | | llvm-svn: 184909
* Use llvm::sys::fs::unique_file.Rafael Espindola2013-06-261-26/+7
| | | | llvm-svn: 184908
* Remove some uses of llvm::sys::Path.Rafael Espindola2013-06-261-6/+6
| | | | llvm-svn: 184907
* [libclang/codecompletion] Make sure the top-level decl hash takes into ↵Argyrios Kyrtzidis2013-06-241-1/+9
| | | | | | | | | | | account ImportDecls. The top-level hash is used to determine if we need to update the global code-completion results. ImportDecls did not affect the hash so a newly introduced ImportDecl would not trigger an update of the global results. rdar://14202797 llvm-svn: 184782
* Use the new name of getUniqueID.Rafael Espindola2013-06-201-5/+5
| | | | llvm-svn: 184432
* Use llvm::sys::fs::GetUniqueID.Rafael Espindola2013-06-181-15/+22
| | | | llvm-svn: 184218
* Include PathV1.h in files that use it.Rafael Espindola2013-06-111-0/+1
| | | | | | This is preparation for replacing Path.h with PathV2.h. llvm-svn: 183781
* Modify a comment to reflect changes of r183717.Argyrios Kyrtzidis2013-06-111-2/+2
| | | | llvm-svn: 183751
* ASTUnit: Invert the dependency of PrecompilePreambleAction on ↵Benjamin Kramer2013-06-111-40/+43
| | | | | | | | PrecompilePreambleConsumer. Actions outlive consumers. PR16295. Found by AddressSanitizer. llvm-svn: 183741
* [libclang] Allow building a precompiled preamble with compiler errorsArgyrios Kyrtzidis2013-06-111-7/+15
| | | | | | | | | | | A while ago we allowed libclang to build a PCH that had compiler errors; this was to retain the performance afforded by a PCH even if the user's code is in an intermediate state. Extend this for the precompiled preamble as well. rdar://14109828 llvm-svn: 183717
* [modules] If we hit a failure while loading a PCH/module, abort parsing ↵Argyrios Kyrtzidis2013-05-241-1/+6
| | | | | | | | | | instead of trying to continue in an invalid state. Also don't let libclang create a PCH with such an error. Fixes rdar://13953768 llvm-svn: 182629
* [libclang] When parsing with CXTranslationUnit_ForSerialization, make sure ↵Argyrios Kyrtzidis2013-05-101-0/+10
| | | | | | | | to install the ASTWriter that we create as an ASTMutationListener. Fixes rdar://13833268 llvm-svn: 181575
* [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.Argyrios Kyrtzidis2013-05-081-11/+3
| | | | | | | | This made sense in pre-module era, before merging of HeaderFileInfos was introduced. Final part of rdar://13840148. llvm-svn: 181490
* Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.Benjamin Kramer2013-05-051-8/+9
| | | | llvm-svn: 181150
* Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor2013-05-031-11/+1
| | | | llvm-svn: 181070
* When building a module, forward diagnostics to the outer diagnostic consumer.Douglas Gregor2013-05-031-4/+24
| | | | | | | | | | | | | | | Previously, we would clone the current diagnostic consumer to produce a new diagnostic consumer to use when building a module. The problem here is that we end up losing diagnostics for important diagnostic consumers, such as serialized diagnostics (where we'd end up with two diagnostic consumers writing the same output file). With forwarding, the diagnostics from all of the different modules being built get forwarded to the one serialized-diagnostic consumer and are emitted in a sane way. Fixes <rdar://problem/13663996>. llvm-svn: 181067
* <rdar://problem/13363214> Eliminate race condition between module rebuild ↵Douglas Gregor2013-03-191-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
* [libclang] When logging a CXTranslationUnit that came from an AST file, ↵Argyrios Kyrtzidis2013-03-051-0/+9
| | | | | | print out the filename. llvm-svn: 176511
* [preprocessor] Use MacroDirective in the preprocessor callbacks to make ↵Argyrios Kyrtzidis2013-02-241-1/+2
| | | | | | | | available the full information about the macro (e.g if it was imported and where). llvm-svn: 175978
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-221-0/+5
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-231-2/+2
| | | | llvm-svn: 173277
* [ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a ↵Argyrios Kyrtzidis2013-01-211-0/+2
| | | | | | | | | | crash if Precompilepreamble is set to true because there is no FileManager at that point. Patch by Hurcan Solter! llvm-svn: 173071
* Nuke SetUpBuildDumpLog.Sean Silva2013-01-201-5/+2
| | | | | | | Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. llvm-svn: 172945
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* [libclang] In ASTUnit::getMainFileName() Invocation may be null because the ↵Argyrios Kyrtzidis2013-01-111-1/+15
| | | | | | | | ASTUnit came from loading a PCH/module. llvm-svn: 172259
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-1/+1
| | | | llvm-svn: 171367
* [libclang] Don't try to translate diagnostics from the precompiled preamble ↵Argyrios Kyrtzidis2012-12-221-11/+0
| | | | | | | | | | | to the code-completion results, the SourceManager state may be slightly different when code-completing. And we don't even care for diagnostics when code-completing, anyway. llvm-svn: 170979
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-14/+14
| | | | | | | | | | | | | 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
* Since CreateTargetInfo is taking ownership of the target options, passDouglas Gregor2012-11-161-6/+6
| | | | | | it as a pointer. llvm-svn: 168136
* [libclang] When caching code-completion results, pass the ↵Argyrios Kyrtzidis2012-11-161-4/+5
| | | | | | | | | | | | | | CachedCompletionAllocator to the CodeCompletionTUInfo that is going to be used to get the results. Previously we would use ASTUnit's CodeCompletionTUInfo which has its own allocator that will go away when we reparse. That could result in a use-after-free bug when getting the parent context name from a CodeCompletionString. Addresses rdar://12568377. llvm-svn: 168133
* [modules] Setup the import location of a module file and use itArgyrios Kyrtzidis2012-11-151-1/+1
| | | | | | as the include location of the main file of an imported module. llvm-svn: 168061
* Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko2012-11-151-2/+2
| | | | llvm-svn: 168041
* Turn FrontendInputFile into an immutable class and have it also acceptArgyrios Kyrtzidis2012-11-091-20/+20
| | | | | | a memory buffer instead of only a filename. llvm-svn: 167627
* When code-completing don't disable the preprocessing record if modules are ↵Argyrios Kyrtzidis2012-11-021-2/+3
| | | | | | enabled. llvm-svn: 167325
* [PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis2012-10-311-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
* Decouple code-completion for the SkipFunctionBodies frontend option andArgyrios Kyrtzidis2012-10-311-2/+0
| | | | | | add a test to make sure code-completion skips bodies. llvm-svn: 167141
* Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.Rafael Espindola2012-10-291-4/+0
| | | | llvm-svn: 166981
* ASTUnit doesn't actually care about the predefines; don't record them.Douglas Gregor2012-10-251-18/+2
| | | | llvm-svn: 166650
* Teach the preprocessor to hold onto the preprocessor options.Douglas Gregor2012-10-241-1/+3
| | | | llvm-svn: 166599
* Move HeaderSearchOptions into the Lex library, make it intrusivelyDouglas Gregor2012-10-241-1/+4
| | | | | | reference-counted, and hold a reference to it in HeaderSearch. llvm-svn: 166583
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-4/+4
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* If the precompiled header named by "-include" is actually a directory,Douglas Gregor2012-10-231-9/+2
| | | | | | | | | check each of the files within that directory to determine if any of them is an AST file that matches the language and target options. If so, the first matching AST file is loaded. This fixes a longstanding discrepency with GCC's precompiled header implementation. llvm-svn: 166469
* Allow clients of the AST reader to specify what kinds of AST loadDouglas Gregor2012-10-221-4/+8
| | | | | | | | | | 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
* Distinguish the various kinds of AST file loading failures:Douglas Gregor2012-10-221-1/+4
| | | | | | | | file corruption, compiler version mismatch, target/language configuration mismatch, out-of-date AST file. No functionality change yet. llvm-svn: 166446
* Serialize TargetOptions into an AST file, and make sure that we keepDouglas Gregor2012-10-161-22/+10
| | | | | | | target options around so they can be accessed at any point (rather than keeping them transient). llvm-svn: 166072
* Teach TargetInfo to hold on to the TargetOptions with which it wasDouglas Gregor2012-10-151-4/+6
| | | | | | created. llvm-svn: 165943
* [libclang] Improve AST serialization done by ASTUnit::Save().Argyrios Kyrtzidis2012-10-111-28/+64
| | | | | | | | | The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. llvm-svn: 165717
* When indexing a module file, for the ppIncludedFile callback giveArgyrios Kyrtzidis2012-10-101-5/+11
| | | | | | | an invalid location if the location points to the synthetic buffer for the module input. llvm-svn: 165592
* [libclang] When indexing, invoke the importedASTFile for PCH files as well.Argyrios Kyrtzidis2012-10-031-0/+36
| | | | llvm-svn: 165161
OpenPOWER on IntegriCloud