summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement (de-)serialization of the description of a module and itsDouglas Gregor2011-11-301-26/+34
| | | | | | | | | submodules. This information will eventually be used for name hiding when dealing with submodules. For now, we only use it to ensure that the module "key" returned when loading a module will always be a module (rather than occasionally being a FileEntry). llvm-svn: 145497
* Teach the preprocessor how to handle module import declarations thatDouglas Gregor2011-11-301-0/+8
| | | | | | | involve submodules (e.g., importing std.vector), rather than always importing the top-level module. llvm-svn: 145478
* When loading a module that involves submodules (e.g., std.vector),Douglas Gregor2011-11-301-82/+150
| | | | | | | | | check whether the named submodules themselves are actually valid, and drill down to the named submodule (although we don't do anything with it yet). Perform typo correction on the submodule names when possible. llvm-svn: 145477
* Switch the module-loading interfaces and parser from a simpleDouglas Gregor2011-11-301-10/+14
| | | | | | | top-level module name to a module path (e.g., std.vector). We're still missing a number of pieces for this actually to do something. llvm-svn: 145462
* Switch on-demand module building over to use module maps, always. WhenDouglas Gregor2011-11-291-72/+46
| | | | | | | we infer the module map, we'll just print the module map to a temporary file and generate the module using that. llvm-svn: 145436
* Teach the module import mechanism how to rebuild modules expressed viaDouglas Gregor2011-11-291-8/+64
| | | | | | | module map, rather than assuming that there is an umbrella header. This allows us to automatically build umbrella-less modules. llvm-svn: 145415
* Start refactoring to use module maps when rebuilding a moduleDouglas Gregor2011-11-291-12/+15
| | | | | | on-the-fly. No functionality change. llvm-svn: 145414
* When attempting to load a module that is not in the module cache,Douglas Gregor2011-11-281-7/+7
| | | | | | | | return the module itself (in the module map) rather than returning the umbrella header used to build the module. While doing this, make sure that we're inferring modules for frameworks to build that module. llvm-svn: 145310
* Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted ↵Ted Kremenek2011-11-171-3/+3
| | | | | | | | | | | | | | | | | object. I discovered that llvm::RefCountedBase<T> has a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted, we can keep it around after the CompilerInvocation object goes away. As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this object may outlive the CompilerInvocation object. This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to mainline LLVM. llvm-svn: 144930
* 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
OpenPOWER on IntegriCloud