summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Frontend: Lift InputKind enumeration to top level.Daniel Dunbar2010-06-071-1/+1
| | | | llvm-svn: 105577
* MemoryBuffer::getSTDIN may return a null pointer if an error occurs.Dan Gohman2010-05-271-1/+1
| | | | llvm-svn: 104856
* Only enable code patterns (e.g., try { statements } catch (...) {Douglas Gregor2010-05-251-2/+4
| | | | | | statements }) in the code-completion results if explicitly requested. llvm-svn: 104637
* Once we've emitted a fatal diagnostic, keep counting errors but with aDouglas Gregor2010-04-141-1/+2
| | | | | | | | | | | | | | separate count of "suppressed" errors. This way, semantic analysis bits that depend on the error count to determine whether problems occured (e.g., some template argument deduction failures, jump-scope checking) will not get confused. The actual problem here is that a missing #include (which is a fatal error) could cause the jump-scope checker to run on invalid code, which it is not prepared to do. Trivial fix for both <rdar://problem/7775941> and <rdar://problem/7775709>. llvm-svn: 101297
* Instead of counting totally diagnostics, split the count into a countChris Lattner2010-04-071-5/+13
| | | | | | | | | | | | | | | of errors and warnings. This allows us to emit something like this: 2 warnings and 1 error generated. instead of: 3 diagnostics generated. This also stops counting 'notes' because they are just follow-on information about the previous diag, not a diagnostic in themselves. llvm-svn: 100675
* Make Diagnostic reference-counted, which is simpler than jugglingDouglas Gregor2010-04-051-7/+8
| | | | | | maybe-ownership vs. ownership. llvm-svn: 100498
* Teach Clang's -cc1 option -print-stats to print LLVM statistics.Douglas Gregor2010-03-301-0/+4
| | | | llvm-svn: 99894
* clang -cc1: Kill off -empty-input only, and replace with -init-only which is anDaniel Dunbar2010-03-191-6/+1
| | | | | | | | actual action. - This is easier to use, and more reliable for timing the thing this was actually meant to be useful for. llvm-svn: 98978
* Optionally store a PreprocessingRecord in the preprocessor itself, andDouglas Gregor2010-03-191-0/+3
| | | | | | tie its creation to a CC1 flag -detailed-preprocessing-record. llvm-svn: 98963
* Simplify error path using OwningPtrKovarththanan Rajaratnam2010-03-171-4/+3
| | | | llvm-svn: 98722
* Simplify ProcessWarningOptions since it can't failKovarththanan Rajaratnam2010-03-171-2/+1
| | | | llvm-svn: 98721
* Issue a proper diagnostic if we couldn't open dump fileKovarththanan Rajaratnam2010-03-171-7/+6
| | | | llvm-svn: 98719
OpenPOWER on IntegriCloud