summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* In the Module class, add a reference to the corresponding AST file.Argyrios Kyrtzidis2012-09-291-0/+3
| | | | llvm-svn: 164873
* Add a new libclang completion API to get brief documentation comment that isDmitri Gribenko2012-07-021-8/+3
| | | | | | | | | | | | | | | | attached to a declaration in the completion string. Since extracting comments isn't free, a new code completion option is introduced. A new code completion option that enables including brief comments into CodeCompletionString should be a, err, code completion option. But because ASTUnit caches global declarations during parsing before even completion consumer is created, the option is duplicated as a translation unit option (in both libclang and ASTUnit, like the option to cache code completion results). llvm-svn: 159539
* Pulls diagnostics for temp file handling into the common diagnostic kinds.Manuel Klimek2012-05-161-1/+1
| | | | llvm-svn: 156947
* For final output files create them with mode 0664 to match otherEric Christopher2012-05-111-1/+2
| | | | | | | | compilers and expected defaults. Part of rdar://11325849 llvm-svn: 156592
* Remove variables made dead by r155923David Blaikie2012-05-011-2/+0
| | | | | | This makes Clang's build warning free again. llvm-svn: 155928
* Remove dead code found by static analyzer.Ted Kremenek2012-05-011-5/+0
| | | | llvm-svn: 155923
* objective-c modern translator: buildit objc boolFariborz Jahanian2012-04-161-0/+4
| | | | | | | type for rewriter project will be BoolTy. // rdar://11231426. llvm-svn: 154861
* Changed all direct calls to CompletionConsumer.reset(..) to go callErik Verbruggen2012-04-121-4/+4
| | | | | | | | CompilerInstance::setCodeCompletionConsumer instead, in order to change the SkipFunctionBodies flag accordingly. Also fixed setCodeCompletionConsumer to take a reset() to null into account. llvm-svn: 154585
* Added a flag to the parser to skip method bodies.Erik Verbruggen2012-04-121-0/+1
| | | | llvm-svn: 154584
* [PCH] Mark a PCH file with a flag to indicate if the serialized AST hadArgyrios Kyrtzidis2012-03-071-1/+5
| | | | | | | | | | | | | | | | compiler errors or not. -Control whether ASTReader should reject such a PCH by a boolean flag at ASTReader's creation time. By default, such a PCH file will be rejected with an error when trying to load it. [libclang] Allow clang_saveTranslationUnit to create a PCH file even if compiler errors occurred. -Have libclang API calls accept a PCH that had compiler errors. The general idea is that we want libclang to stay functional even if a PCH had a compiler error. rdar://10976363. llvm-svn: 152192
* [preprocessor] Enhance PreprocessingRecord to keep track of locations of ↵Argyrios Kyrtzidis2012-03-051-1/+1
| | | | | | | | | conditional directives. Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns true if a given range intersects with a conditional directive block. llvm-svn: 152018
* Frontend: Default to creating output files using temporary files + rename.Daniel Dunbar2012-03-031-1/+2
| | | | | | | | | - This is a more reliable default, as it behaves better on failure and also ensures that we create *new* files (instead of reusing existing inodes). This is useful for other applications (like lldb) which want to cache inode's to know when a file has been rewritten. llvm-svn: 151961
* Frontend: Don't automatically create missing directories when using ↵Daniel Dunbar2012-03-031-6/+20
| | | | | | | | temporary files with createOutputFile() - This would otherwise happen as a side effect of llvm::sys::fs::unique_file creating parent directories. llvm-svn: 151960
* Don't record nested macro expansions in the preprocessing record,Argyrios Kyrtzidis2012-02-251-2/+1
| | | | | | | | it can only bring pain when dealing with preprocessor abuse (see: boost). rdar://10898986 llvm-svn: 151427
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-4/+4
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-5/+5
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-7/+7
| | | | llvm-svn: 149798
* Rename -dependency-graphviz to -dependencncy-dotDouglas Gregor2012-02-021-2/+2
| | | | llvm-svn: 149645
* Introduce a -cc1 option "-dependency-graphviz" that determines headerDouglas Gregor2012-02-021-0/+4
| | | | | | dependencies and outputs them in GraphViz format. llvm-svn: 149575
* Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor2012-01-301-2/+3
| | | | | | target-specific module requirements. llvm-svn: 149224
* Switch over to LLVM's file-level locking facilityDouglas Gregor2012-01-291-265/+5
| | | | llvm-svn: 149204
* Ensure that we clean up after a failed module build and cope with theDouglas Gregor2012-01-291-1/+1
| | | | | | results in libclang. llvm-svn: 149200
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-291-1/+0
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* Rework HeaderSearch's interface for getting a module from a name andDouglas Gregor2012-01-291-4/+18
| | | | | | | | | for getting the name of the module file, unifying the code for searching for a module with a given name (into lookupModule()) and separating out the mapping to a module file (into getModuleFileName()). No functionality change. llvm-svn: 149197
* Introduce module attributes into the module map grammar, along with aDouglas Gregor2012-01-271-5/+8
| | | | | | | | | | | | | single attribute ("system") that allows us to mark a module as being a "system" module. Each of the headers that makes up a system module is considered to be a system header, so that we (for example) suppress warnings there. If a module is being inferred for a framework, and that framework directory is within a system frameworks directory, infer it as a system framework. llvm-svn: 149143
* 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
OpenPOWER on IntegriCloud