summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Extract the (InputKind, std::string) pair used to describe inputs toDouglas Gregor2012-01-201-5/+4
| | | | | | | the front end into its own class, FrontendInputFile, to make it easier to introduce new per-input data. No functionality change. llvm-svn: 148546
* Store the submodules of a module in source order, as they are storedDouglas Gregor2012-01-041-12/+14
| | | | | | | | in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
* Implement support for module requirements, which indicate the languageDouglas Gregor2011-12-311-1/+15
| | | | | | | | | features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). llvm-svn: 147387
* Detect when mapping a #include/#import over to a submodule ends upDouglas Gregor2011-12-201-2/+16
| | | | | | | | | | | | | hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. llvm-svn: 146933
* Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This ↵Ted Kremenek2011-12-171-1/+1
| | | | | | | | | | gives us comparative diagnostics to TextDiagnosticPrinter. This certainly can be cleaned up a bit. llvm-svn: 146820
* Revert r146646 that was a mistake, and make the intended change in the right ↵Argyrios Kyrtzidis2011-12-151-3/+0
| | | | | | | | | file. Log: [libclang] Try to unbreak mingw build. llvm-svn: 146647
* [libclang] Try to unbreak mingw build.Argyrios Kyrtzidis2011-12-151-0/+3
| | | | llvm-svn: 146646
* Keep track of import dependencies between submodules within the moduleDouglas Gregor2011-12-081-8/+13
| | | | | | | that's currently being built. This is important for supporting transitive dependencies ("export *" in the module map) completely. llvm-svn: 146156
* Make changes to SDiagsWriter to make it work in combination with the ARC ↵Argyrios Kyrtzidis2011-12-071-1/+4
| | | | | | | | | | | | | migrator: -Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization file inside this method. -Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the Diagnostic object. -Ignore null source ranges. llvm-svn: 146020
* If we can't write the temporary module map file when compiling aDouglas Gregor2011-12-071-1/+2
| | | | | | module, at least have the decency to complain about it. llvm-svn: 146002
* Add a FIXME to provide a sensible error message hereDouglas Gregor2011-12-061-2/+3
| | | | llvm-svn: 145983
* Use absolute paths for temporary module map filesDouglas Gregor2011-12-061-1/+1
| | | | llvm-svn: 145973
* When we treat an #include or #import as a module import, create anDouglas Gregor2011-12-021-3/+13
| | | | | | | implicit ImportDecl in the translation unit to record the presence of the import. llvm-svn: 145727
* Introduce the notion of name visibility into modules. For a givenDouglas Gregor2011-12-011-3/+10
| | | | | | | | | | | | | | (sub)module, all of the names may be hidden, just the macro names may be exposed (for example, after the preprocessor has seen the import of the module but the parser has not), or all of the names may be exposed. Importing a module makes its names, and the names in any of its non-explicit submodules, visible to name lookup (transitively). This commit only introduces the notion of name visible and marks modules and submodules as visible when they are imported. The actual name-hiding logic in the AST reader will follow (along with test cases). llvm-svn: 145586
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-301-7/+7
| | | | | | | | | library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538
* Don't collide loop variable names (to appease GCC)Matt Beaumont-Gay2011-11-301-7/+6
| | | | llvm-svn: 145515
* 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
OpenPOWER on IntegriCloud