summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r144703. It was a dumb idea anyway; will add the new bits moreDouglas Gregor2011-11-151-6/+5
| | | | | | incrementally with a new frontend action. llvm-svn: 144723
* Split GenerateModuleAction into its own action, which will startDouglas Gregor2011-11-151-5/+6
| | | | | | differing from GeneratePCHAction fairly soon. llvm-svn: 144703
* Add a -cc1-level option -fmodule-name=<name>, which will be used whenDouglas Gregor2011-11-151-3/+4
| | | | | | building modules. llvm-svn: 144680
* I predict that HeaderSearch will need the ability to generateDouglas Gregor2011-11-111-1/+2
| | | | | | diagnostics in the future. Make it so. llvm-svn: 144347
* rename getHostTriple into getDefaultTargetTriple in clangSebastian Pop2011-11-011-1/+1
| | | | llvm-svn: 143503
* Start work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that ↵Ted Kremenek2011-10-291-0/+27
| | | | | | | | | | | | | | | serializes out the diagnostics for a given translation unit to a bit code file. This is a WIP. The motivation for this new DiagnosticConsumer is to provide a way for tools invoking the compiler to get its diagnostics via a libclang interface, rather than textually parsing the compiler output. This gives us flexibility to change the compiler's textual output, but have a structured data format for clients to use to get the diagnostics via a stable API. I have no tests for this, but llvm-bcanalyzer so far shows that the emitted file is well-formed. More work to follow. llvm-svn: 143259
* lib/Frontend/CompilerInstance.cpp: Suppress a "Comparision of unsigned and ↵NAKAMURA Takumi2011-10-081-1/+1
| | | | | | signed" warning on Cygwin gcc-4.3.4. llvm-svn: 141488
* WhitespaceNAKAMURA Takumi2011-10-081-87/+87
| | | | llvm-svn: 141486
* Seriously ugly hack, part 2Douglas Gregor2011-10-051-1/+7
| | | | llvm-svn: 141181
* Seriously ugly hack to try to get the Windows builders back onlineDouglas Gregor2011-10-051-2/+15
| | | | llvm-svn: 141180
* Introduce a simple file-based locking protocol for on-demand moduleDouglas Gregor2011-10-051-0/+259
| | | | | | | | | | | creation, so that only a single Clang instance will rebuild a given module at once (and the others will wait). We still don't clean up the lock files when we crash, which is a rather unfortunate problem. I'll handle that next, and there is certainly a *lot* of room for further improvements. llvm-svn: 141179
* When build a module on demand, run the module-building job on aDouglas Gregor2011-10-041-3/+21
| | | | | | | separate thread with the "suitably large" stack, so we don't blow the stack when building modules recursively. llvm-svn: 141051
* Introduce an opt-in warning when a module is being implicitly builtDouglas Gregor2011-09-291-0/+2
| | | | | | from sources. llvm-svn: 140746
* Introduce a pure virtual clone() method to DiagnosticConsumer, so thatDouglas Gregor2011-09-291-13/+13
| | | | | | | | | we have the ability to create a new, distict diagnostic consumer when we go off and build a module. This avoids the currently horribleness where the same diagnostic consumer sees diagnostics for multiple translation units (and multiple SourceManagers!) causing all sorts of havok. llvm-svn: 140743
* Rename VerifyDiagnosticsClient to VerifyDiagnosticConsumer as per issue 5397David Blaikie2011-09-261-2/+2
| | | | llvm-svn: 140489
* Rename ChainedDiagnosticClient to ChainedDiagnosticConsumer as per issue 5397David Blaikie2011-09-261-3/+3
| | | | llvm-svn: 140485
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie2011-09-251-3/+3
| | | | llvm-svn: 140479
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-6/+7
| | | | llvm-svn: 140478
* [libclang] When getting a source location from a file:line:col tripletArgyrios Kyrtzidis2011-09-191-5/+2
| | | | | | | check whether the requested location points inside the precompiled preamble, in which case the returned source location will be a "loaded" one. llvm-svn: 140060
* Add an experimental flag -fauto-module-import that automatically turnsDouglas Gregor2011-09-151-1/+4
| | | | | | | #include or #import direcctives of framework headers into module imports of the corresponding framework module. llvm-svn: 139860
* Comment what's going on when we compile a moduleDouglas Gregor2011-09-151-0/+8
| | | | llvm-svn: 139837
* Detect cyclic module dependencies in a manner that is rather moreDouglas Gregor2011-09-151-0/+23
| | | | | | graceful than running out of stack space. llvm-svn: 139833
* When we load the first module, make sure that we wire up the ASTConsumer to ↵Douglas Gregor2011-09-151-0/+2
| | | | | | the newly-created ASTReader. This makes sure that CodeGen sees the declarations it is interested in llvm-svn: 139824
* Make -E work with module importsDouglas Gregor2011-09-141-5/+11
| | | | llvm-svn: 139750
* Assert that the module hash produced after stripping away non-modular ↵Douglas Gregor2011-09-131-3/+2
| | | | | | options is the same as the module hash before stripping those options. llvm-svn: 139663
* For modules, use a hash of the compiler version, language options, andDouglas Gregor2011-09-131-12/+14
| | | | | | | | | target triple to separate modules built under different conditions. The hash is used to create a subdirectory in the module cache path where other invocations of the compiler (with the same version, language options, etc.) can find the precompiled modules. llvm-svn: 139662
* When building a module on-demand, clear out the "non-modular" languageDouglas Gregor2011-09-131-0/+3
| | | | | | and preprocessor options (such as macro definitions) first. llvm-svn: 139638
* When compiling a module on-demand, re-use the diagnostics clientDouglas Gregor2011-09-131-9/+20
| | | | | | | | already provided. This required a little bit of clean-up in the way that VerifyDiagnosticsClient managed ownership of its underlying "primary" client, because now it will no longer always take ownership. llvm-svn: 139570
* When an import statement fails to find a module in the module cache,Douglas Gregor2011-09-121-2/+76
| | | | | | | | | but there is a corresponding umbrella header in a framework, build the module on-the-fly so it can be immediately loaded at the import statement. This is very much proof-of-concept code, with details to be fleshed out over time. llvm-svn: 139558
* Introduce a cc1-level option to provide the path to the module cache,Douglas Gregor2011-09-121-7/+1
| | | | | | | | where the compiler will look for module files. Eliminates the egregious hack where we looked into the header search paths for modules. llvm-svn: 139538
* Always construct an ASTReader with a non-NULL ASTContext andDouglas Gregor2011-09-021-2/+2
| | | | | | | | | Preprocessor, eliminating the constructor that was used by ASTUnit (which didn't provide an ASTContext or Prepreprocessor). Ensuring that both objects are non-NULL will simplify module loading (but none of that is done yet). llvm-svn: 138986
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Allow the preprocessor to be constructed without performing target-Douglas Gregor2011-09-011-1/+1
| | | | | | | | and language-specific initialization. Use this to allow ASTUnit to create a preprocessor object *before* loading the AST file. No actual functionality change. llvm-svn: 138983
* Switch the "no module found" default-fatal warning to a default-fatal error.Douglas Gregor2011-08-311-1/+1
| | | | llvm-svn: 138909
* Introduce support for a simple module import declaration, whichDouglas Gregor2011-08-261-32/+80
| | | | | | | | | | | | | | | | | | | | | | loads the named module. The syntax itself is intentionally hideous and will be replaced at some later point with something more palatable. For now, we're focusing on the semantics: - Module imports are handled first by the preprocessor (to get macro definitions) and then the same tokens are also handled by the parser (to get declarations). If both happen (as in normal compilation), the second one is redundant, because we currently have no way to hide macros or declarations when loading a module. Chris gets credit for this mad-but-workable scheme. - The Preprocessor now holds on to a reference to a module loader, which is responsible for loading named modules. CompilerInstance is the only important module loader: it now knows how to create and wire up an AST reader on demand to actually perform the module load. - We search for modules in the include path, using the module name with the suffix ".pcm" (precompiled module) for the file name. This is a temporary hack; we hope to improve the situation in the future. llvm-svn: 138679
* Introduce a -cc1 option "-emit-module", that creates a binary moduleDouglas Gregor2011-08-251-2/+2
| | | | | | | | | from the given source. -emit-module behaves similarly to -emit-pch, except that Sema is somewhat more strict about the contents of -emit-module. In the future, there are likely to be more interesting differences. llvm-svn: 138595
* Cut down the number of open/close system calls for output files.Argyrios Kyrtzidis2011-07-281-15/+26
| | | | | | | | | For PCH files, have only one open/close for temporary + rename to be safe from race conditions. For all other output files open/close the output file directly. Depends on llvm r136310. rdar://9082880 & http://llvm.org/PR9374. llvm-svn: 136315
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-17/+17
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Switch all of the "isysroot" const char*'s throughout the AST readerDouglas Gregor2011-07-221-1/+1
| | | | | | and writer to StringRef or std::string, as appropriate. llvm-svn: 135769
* Rename ASTReader::PerFileData to serialization::Module, pulling it outDouglas Gregor2011-07-221-2/+3
| | | | | | | of ASTReader so it can become its own full-fledged class (eventually). No functionality change. llvm-svn: 135767
* Cut down one open/close pair of system calls by using Path's makeUnique ↵Argyrios Kyrtzidis2011-07-211-1/+1
| | | | | | instead of createTemporaryFileOnDisk. llvm-svn: 135690
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth2011-07-141-1/+1
| | | | | | | | | | | | | | | | This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
* avoid using config.h in public headersDylan Noblesmith2011-06-231-0/+1
| | | | | | | | | | | This is the only usage in clang's headers, and it's for a define that only exists on CMake builds for the sake of the MSVC compiler, so just use an ifdef instead. Also add an include for config.h in a file that actually needs it, and was picking it up by accident indirectly. llvm-svn: 133710
* Raise the ARCMT functionality in Clang into proper FrontendActions.Chandler Carruth2011-06-161-29/+0
| | | | | | | | | | | | | | | | | | | | | These are somewhat special in that they wrap any other FrontendAction, running various ARC transformations or checks prior to the standard action's run. To implement them easily, this extends FrontendAction to have a WrapperFrontendAction utility class which forwards all calls by default to an inner action setup at construction time. This is then subclassed to override the specific behavior needed by the different ARCMT tools. Finally, FrontendTool is taught how to create these wrapper actions from the existing flags and options structures. The result is that clangFrontend no longer depends on clangARCMigrate. This is very important, as clangARCMigrate *heavily* depends on clangFrontend. Fundamentally ARCMigrate is at the same layer as a library like Rewrite, sitting firmly on top of the Frontend, but tied together with the FrontendTool when building the clang binary itself. llvm-svn: 133161
* The ARC Migration Tool. All the credit goes to Argyrios and FariborzJohn McCall2011-06-151-0/+29
| | | | | | for this. llvm-svn: 133104
* Introduce a new libclang parsing flag,Douglas Gregor2011-05-061-1/+2
| | | | | | | | | | | | | CXTranslationUnit_NestedMacroInstantiations, which indicates whether we want to see "nested" macro instantiations (e.g., those that occur inside other macro instantiations) within the detailed preprocessing record. Many clients (e.g., those that only care about visible tokens) don't care about this information, and in code that uses preprocessor metaprogramming, this information can have a very high cost. Addresses <rdar://problem/9389320>. llvm-svn: 130990
* Frontend/CC_LOG_DIAGNOSTICS: Fix thinko and open diag log in append mode.Daniel Dunbar2011-04-071-1/+1
| | | | llvm-svn: 129103
* Fronted/CC_LOG_DIAGNOSTICS: Wire up dwarf-debug-flags support.Daniel Dunbar2011-04-071-5/+10
| | | | llvm-svn: 129095
* Frontend: Sketch a LogDiagnosticPrinter object, and wire CC_LOG_DIAGNOSTICS toDaniel Dunbar2011-04-071-0/+32
| | | | | | it. llvm-svn: 129089
OpenPOWER on IntegriCloud