summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don'tDaniel Dunbar2011-03-211-1/+2
| | | | | | really make any sense in this environment. llvm-svn: 128014
* Improve crash recovery cleanup to recovery CompilerInstances during crash ↵Ted Kremenek2011-03-211-22/+18
| | | | | | | | | | recovery. This was a huge resource "root" during crashes. This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance object. llvm-svn: 128011
* Get rid of the static FileManager::FixupRelativePath.Anders Carlsson2011-03-141-1/+1
| | | | llvm-svn: 127573
* Convert FileManager::FixupRelativePath over to using PathV2.Anders Carlsson2011-03-061-9/+12
| | | | llvm-svn: 127133
* Re-instate r125819 and r125820 with no functionality changePeter Collingbourne2011-02-191-5/+0
| | | | llvm-svn: 126060
* Revert 125820 and 125819 to fix PR9266.Rafael Espindola2011-02-191-0/+5
| | | | llvm-svn: 126050
* Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenActionPeter Collingbourne2011-02-181-5/+0
| | | | | | | | | This removes the final dependency edge from any lib outside of CodeGen to core. As a result we can, and do, trim the dependency on core from libclang, PrintFunctionNames, the unit tests and c-index-test. While at it, review and trim other unneeded dependencies. llvm-svn: 125820
* Improve our uniquing of file entries when files are re-saved or areDouglas Gregor2011-02-051-2/+5
| | | | | | | | | | | | | | overridden via remapping. Thus, when we create a "virtual" file in the file manager, we still stat() the real file that lives behind it so that we can provide proper uniquing based on inodes. This helps keep the file manager much more consistent. To take advantage of this when reparsing files in libclang, we disable the use of the stat() cache when reparsing or performing code completion, since the stat() cache is very likely to be out of date in this use case. llvm-svn: 124971
* Frontend: Add -header-include-file option, for allowing saving header includeDaniel Dunbar2011-02-021-0/+6
| | | | | | information to a file. llvm-svn: 124750
* Frontend: Factor out header include dumping (-H) into its own preprocessorDaniel Dunbar2011-02-021-0/+4
| | | | | | | | callbacks class. - Aside from being generally cleaner, this also allows -H to work correctly in modes other than standard preprocessing (e.g., -c, -MM, etc.) llvm-svn: 124723
* Frontend: Add an explicit RemoveFileOnSignal flag argument, to control theDaniel Dunbar2011-01-311-3/+6
| | | | | | automatic behavior (which is undesirable in a multithreaded context). llvm-svn: 124612
* Replace all uses of PathV1::exists with PathV2::fs::exists.Michael J. Spencer2011-01-101-1/+3
| | | | llvm-svn: 123150
* MemoryBuffer API update.Michael J. Spencer2010-12-161-4/+3
| | | | llvm-svn: 121956
* Use error_code instead of std::string* for MemoryBuffer.Michael J. Spencer2010-12-091-1/+4
| | | | llvm-svn: 121378
* When loading a precompiled preamble, use the file ID of theDouglas Gregor2010-11-301-2/+5
| | | | | | | | | | | | precompiled preamble as the "main" source file's file ID within the source manager. This makes compiling with a precompiled preamble produce the same source locations as when compiling without the precompiled preamble; prior to this change, we ended up with different file IDs for source locations within the precompiled preamble vs. those after the precompiled preamble, even for entities (e.g., preprocessing entities) in the same file. llvm-svn: 120390
* Merge System into Support.Michael J. Spencer2010-11-291-4/+4
| | | | llvm-svn: 120297
* don't allow remapping PTH file paths with -fworking-directory, theChris Lattner2010-11-231-1/+1
| | | | | | client should just pass in absolute paths. llvm-svn: 120012
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-16/+10
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* give FileManager a 'FileSystemOptions' ivar, which will be usedChris Lattner2010-11-231-1/+1
| | | | | | | to simplify a bunch of code in it. It should ultimately get inlined into FileManager. llvm-svn: 120007
* Remove the hack where, to get the return status, we had special case for ↵Argyrios Kyrtzidis2010-11-181-9/+1
| | | | | | | | VerifyDiagnosticsClient and just check the number of errors from the DiagnosticClient. llvm-svn: 119736
* Since multiple diagnostics can share one diagnostic client, have the client ↵Argyrios Kyrtzidis2010-11-181-3/+4
| | | | | | | | keeping track of the total number of warnings/errors reported. llvm-svn: 119731
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-181-1/+2
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* Improve ASTUnit's capture of diagnostics so that theDouglas Gregor2010-11-111-5/+9
| | | | | | | | | | diagnostic-capturing client lives as long as the ASTUnit itself does. Otherwise, we can end up with crashes when we get a diagnostic outside of parsing/code completion. The circumstances under which this happen are really hard to reproduce, because a file needs to change from under us. llvm-svn: 118751
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-11/+21
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Add support for code completion on stdin.Dan Gohman2010-10-261-1/+4
| | | | llvm-svn: 117414
* Simplify this code: don't check for the same error twoDan Gohman2010-10-261-4/+6
| | | | | | | different ways. Check once, and use an assert to handle consistency checking. llvm-svn: 117397
* Eliminate the (de-)serialization of code completion results, now thatDouglas Gregor2010-10-111-7/+1
| | | | | | libclang does not support out-of-process code completion. llvm-svn: 116253
* Eliminate -fdiagnostics-binary and all of the infrastructure forDouglas Gregor2010-10-111-33/+1
| | | | | | | | emitting diagnostics in a binary form to be consumed by libclang, since libclang no longer does any of its work out-of-process, making this code dead. Besides, this stuff never worked at 100% anyway. llvm-svn: 116250
* Tighten up constness of argv parameters to allow for string literals as ↵Axel Naumann2010-10-111-3/+3
| | | | | | argumants and to reflect actual (non-modifying) use. llvm-svn: 116199
* Give every file that ASTReader loads a type: module, PCH, precompiled ↵Sebastian Redl2010-10-051-3/+7
| | | | | | preamble or main file. Base Decls' PCHLevel on this to make it more sane. llvm-svn: 115626
* Use a temporary file for output which gets renamed after all the writing is ↵Argyrios Kyrtzidis2010-09-171-14/+52
| | | | | | | | finished. This mainly prevents failures and/or crashes when multiple processes try to read/write the same PCH file. (rdar://8392711&8294781); suggestion & review by Daniel! llvm-svn: 114187
* createMainFileID doesn't need its IncludePos argument, sinceDan Gohman2010-08-271-1/+1
| | | | | | | the main file isn't an included file, and the IncludePos is always SourceLocation(). llvm-svn: 112269
* Rename the ASTReader header files.Sebastian Redl2010-08-181-1/+1
| | | | llvm-svn: 111474
* Rename various classes from PCH to AST.Sebastian Redl2010-08-181-2/+2
| | | | llvm-svn: 111471
* Rename PCHReader to ASTReader.Sebastian Redl2010-08-181-5/+5
| | | | llvm-svn: 111467
* Simplify the ownership model for DiagnosticClients, which was reallyDouglas Gregor2010-08-181-14/+5
| | | | | | | convoluted and a bit leaky. Now, the Diagnostic object owns its DiagnosticClient. llvm-svn: 111437
* Reintroduce the serialization library, with fixed dependencies.Sebastian Redl2010-08-171-1/+1
| | | | llvm-svn: 111279
* Revert Sebastian's build-breaking patch.Douglas Gregor2010-08-171-1/+1
| | | | llvm-svn: 111265
* Create a new Serialization module that contains all the PCH code, and will ↵Sebastian Redl2010-08-171-1/+1
| | | | | | contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change. llvm-svn: 111258
* Extend the code-completion caching infrastructure to include globalDouglas Gregor2010-08-151-2/+6
| | | | | | | | | | | | | | | | | | declarations (in addition to macros). Each kind of declaration maps to a certain set of completion contexts, and the ASTUnit completion logic introduces the completion strings for those declarations if the actual code-completion occurs in one of the contexts where it matters. There are a few new code-completion-context kinds. Without these, certain completions (e.g., after "using namespace") would need to suppress all global completions, which would be unfortunate. Note that we don't get the priorities right for global completions, because we don't have enough type information. We'll need a way to compare types in an ASTContext-agnostic way before this can be implemented. llvm-svn: 111093
* The Sema object will get destroyed before all of the others anyway. We don't ↵Douglas Gregor2010-08-131-1/+0
| | | | | | need to force it llvm-svn: 110993
* Teach CompilerInstance to create and hold on to the Sema object usedDouglas Gregor2010-08-121-0/+12
| | | | | | | for parsing, so that it can persist beyond the lifetime of the parsing call. llvm-svn: 110978
* Add code-completion support directly to ASTUnit, which performs codeDouglas Gregor2010-08-041-17/+32
| | | | | | | | | | | | | | completion within the translation unit using the same command-line arguments for parsing the translation unit. Eventually, we'll reuse the precompiled preamble to improve code-completion performance, and this also gives us a place to cache results. Expose this function via the new libclang function clang_codeCompleteAt(), which performs the code completion within a CXTranslationUnit. The completion occurs in-process (clang_codeCompletion() runs code completion out-of-process). llvm-svn: 110210
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-301-6/+9
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor2010-07-271-2/+6
| | | | | | | | | | | | | | | of the usual consistency checks used to determine when a precompiled header is incompatible with the translation unit it's being loaded into. Enable this option when loading a precompiled preamble, because the preamble loader will be performing all of this checking itself. Enable the preamble-based test now that it's working. This option is also useful for debugging Clang's PCH (<rdar://problem/7532213>). llvm-svn: 109475
* Make ASTContext always use the BumpPtrAllocator.Douglas Gregor2010-07-251-1/+0
| | | | llvm-svn: 109375
* Correctly initialize Reader to null.Sebastian Redl2010-07-091-1/+1
| | | | llvm-svn: 107994
* Some preparatory work for chained PCH. No functionality change.Sebastian Redl2010-07-081-0/+2
| | | | llvm-svn: 107915
* Frontend: Move some initialization from CompilerInstance to FrontendAction, ↵Daniel Dunbar2010-06-071-20/+4
| | | | | | to parallel what is done for AST inputs. llvm-svn: 105579
* Frontend: Change FrontendAction::BeginSourceFile to take the input kind ↵Daniel Dunbar2010-06-071-1/+1
| | | | | | instead of an IsAST bool. llvm-svn: 105578
OpenPOWER on IntegriCloud