summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Don't consume tokens past the end-of-file in an @interface. FixesDouglas Gregor2010-03-161-0/+2
| | | | | | <rdar://problem/7735566>. llvm-svn: 98613
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-161-1/+1
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Lowercase for consistencyKovarththanan Rajaratnam2010-03-061-2/+2
| | | | llvm-svn: 97878
* Rework how CIndex handles diagnostics. Rather than using a callback,Douglas Gregor2010-02-181-1/+1
| | | | | | | | | | | | | | | | | | we attach diagnostics to translation units and code-completion results, so they can be queried at any time. To facilitate this, the new StoredDiagnostic class stores a diagnostic in a serializable/deserializable form, and ASTUnit knows how to capture diagnostics in this stored form. CIndex's CXDiagnostic is a thin wrapper around StoredDiagnostic, providing a C interface to stored or de-serialized diagnostics. I've XFAIL'd one test case temporarily, because currently we end up storing diagnostics in an ASTUnit that's never returned to the user (because it contains errors). I'll introduce a temporary fix for this soon; the real fix will be to allow us to return and query invalid ASTs. llvm-svn: 96592
* CompilerInstance: Move LLVMContext member out of constructor.Daniel Dunbar2010-02-161-7/+6
| | | | llvm-svn: 96314
* CompilerInstance: Change to not contain the CompilerInvocation object.Daniel Dunbar2010-01-301-2/+7
| | | | | | | | This allows clients to install their own CompilerInvocation object, which is important for clients that may wish to create references to things like LangOptions whose lifetime will extend past that of the CompilerInstance. llvm-svn: 94923
* Introduce serialization and deserialization of diagnostic informationDouglas Gregor2010-01-281-2/+34
| | | | | | | | | | | | | | | | | so that CIndex can report diagnostics through the normal mechanisms even when executing Clang in a separate process. This applies both when performing code completion and when using ASTs as an intermediary for clang_createTranslationUnitFromSourceFile(). The serialized format is not perfect at the moment, because it does not encapsulate macro-instantiation information. Instead, it maps all source locations back to the instantiation location. However, it does maintain source-range and fix-it information. To get perfect fidelity from the serialized format would require serializing a large chunk of the source manager; at present, it isn't clear if this code will live long enough for that to matter. llvm-svn: 94740
* Predefine __weak attribute when doing objective-cFariborz Jahanian2010-01-131-2/+4
| | | | | | rewriting for any target. (refixes radar 7530235). llvm-svn: 93331
* cc1: Factor out CompilerInstance::ExecuteAction which has the majority of theDaniel Dunbar2010-01-131-0/+87
| | | | | | | | clang -cc1 logic for running an action against a set of options. - This should make it easier to build tools that have a clang -cc1 like interface, but aren't actually part of clang -cc1. llvm-svn: 93282
* Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.Daniel Dunbar2009-12-111-1/+1
| | | | llvm-svn: 91176
* Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try ↵Daniel Dunbar2009-12-031-3/+3
| | | | | | to) update all clients to be able to handle failure. llvm-svn: 90437
OpenPOWER on IntegriCloud