summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendAction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move ChainedIncludesSource into the Frontend library. This never reallyChandler Carruth2011-12-091-1/+1
| | | | | | | | | | belonged in the Serialization library, it's setting up a compilation, not just deserializing. This should fix PR11512, making Serialization actually be layered below Frontend, a long standing layering violation in Clang. llvm-svn: 146233
* Make -error-on-deserialized-decl work correctly by correctly delegating toArgyrios Kyrtzidis2011-10-281-10/+42
| | | | | | the previous ASTDeserializationListener. llvm-svn: 143241
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+2
| | | | llvm-svn: 140478
* Eliminate the list of modules from the preprocessor options. This wasDouglas Gregor2011-09-151-24/+0
| | | | | | | used back when we had an -import-module command-line option, but it's no longer used (or useful). llvm-svn: 139829
* Introduce a -cc1 option "-emit-module", that creates a binary moduleDouglas Gregor2011-08-251-3/+3
| | | | | | | | | 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
* Wire up -import-module to run ReadAST for each module loaded.Jonathan D. Turner2011-08-051-1/+26
| | | | llvm-svn: 136987
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+6
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-191-3/+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
* [arcmt] Fix the ARC migrator. -arcmt-modify requires running before the ↵Argyrios Kyrtzidis2011-06-181-0/+8
| | | | | | | | initialization of SourceManager because it is going to modify the input file. llvm-svn: 133323
* Raise the ARCMT functionality in Clang into proper FrontendActions.Chandler Carruth2011-06-161-0/+38
| | | | | | | | | | | | | | | | | | | | | 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
* Improve crash recovery cleanup to recovery CompilerInstances during crash ↵Ted Kremenek2011-03-211-9/+9
| | | | | | | | | | recovery. This was a huge resource "root" during crashes. This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance object. llvm-svn: 128011
* Introduce '-chain-include' option to specify headers that will be converted ↵Argyrios Kyrtzidis2011-03-091-2/+11
| | | | | | | | | | to chained PCHs in memory without having to use multiple runs and intermediate files. Intended for testing & debugging of chained PCH. llvm-svn: 127339
* Finish up the diagnostic client before we've torn down the ASTReader,Douglas Gregor2011-02-091-3/+3
| | | | | | | since the diagnostic client might poke at source locations that have not yet been deserialized. llvm-svn: 125204
* Improve our uniquing of file entries when files are re-saved or areDouglas Gregor2011-02-051-0/+1
| | | | | | | | | | | | | | overridden via remapping. Thus, when we create a "virtual" file in the file manager, we still stat() the real file that lives behind it so that we can provide proper uniquing based on inodes. This helps keep the file manager much more consistent. To take advantage of this when reparsing files in libclang, we disable the use of the stat() cache when reparsing or performing code completion, since the stat() cache is very likely to be out of date in this use case. llvm-svn: 124971
* Support for -plugin-arg- with -add-pluginNico Weber2011-01-291-1/+1
| | | | llvm-svn: 124551
* Add -add-plugin flag, which runs plugins in addition to codegen.Nico Weber2011-01-251-2/+39
| | | | llvm-svn: 124227
* Such function decls,as objc's objc_msgSend, builtins in Fariborz Jahanian2010-11-301-1/+1
| | | | | | | | | a specific language. We are adding such language info. by extensing Builtins.def and via a language flag added to LIBBUILTIN/BUILTIN and check for that when deciding a name is builtin or not. Implements //rdar://8689273. llvm-svn: 120429
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-1/+1
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* Use hasErrorOccurred() instead of getNumErrors() where it makes sense.Argyrios Kyrtzidis2010-11-181-1/+1
| | | | llvm-svn: 119746
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-2/+3
| | | | | | | | | | | | | | | | | | | 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
* If Consumer object failed to create due to someFariborz Jahanian2010-10-291-0/+2
| | | | | | | user error, fail gracefully. Fixes pr8508. llvm-svn: 117692
* Put the mechanism in place to track modifications in an AST entity that were ↵Argyrios Kyrtzidis2010-10-241-0/+2
| | | | | | | | | | | | committed after its initial creation/deserialization and store the changes in a chained PCH. The idea is that the AST entities call methods on the ASTMutationListener to give notifications of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes of the updated entity. WIP llvm-svn: 117235
* Give a default implementation for ASTDeserializationListener's methods, no ↵Argyrios Kyrtzidis2010-10-141-14/+0
| | | | | | functionality change. llvm-svn: 116506
* Introduce command line option -error-on-deserialized-decl that is ↵Argyrios Kyrtzidis2010-10-141-0/+39
| | | | | | | | | | accompanied by a name and emits an error if a declaration with this name is deserialized from PCH. This is for testing, to make sure that we don't deserialize stuff needlessly. llvm-svn: 116505
* Introduce command line option -dump-deserialized-decls which is used to ↵Argyrios Kyrtzidis2010-10-141-2/+37
| | | | | | print the PCH decls that got deserialized, for testing purposes. llvm-svn: 116503
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-1/+1
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* More PCH -> AST renaming.Sebastian Redl2010-08-181-1/+1
| | | | llvm-svn: 111472
* Rename various classes from PCH to AST.Sebastian Redl2010-08-181-1/+1
| | | | llvm-svn: 111471
* Teach CompilerInstance to create and hold on to the Sema object usedDouglas Gregor2010-08-121-6/+12
| | | | | | | for parsing, so that it can persist beyond the lifetime of the parsing call. llvm-svn: 110978
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-301-5/+8
| | | | | | 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-1/+2
| | | | | | | | | | | | | | | 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
* When given the -chained-pch option and a previous PCH file, have the ↵Sebastian Redl2010-07-091-4/+7
| | | | | | PCHWriter emit a CHAINED_METADATA record instead of METADATA, and write a link to the previous file there. llvm-svn: 108014
* Frontend: Add FrontendAction support for handling LLVM IR inputs.Daniel Dunbar2010-06-071-1/+18
| | | | | | - These inputs follow an abbreviated execution path, but are still worth handling by FrontendAction so they reuse all the other clang -cc1 features. llvm-svn: 105582
* FrontendAction: Track active file kind.Daniel Dunbar2010-06-071-5/+7
| | | | llvm-svn: 105581
* Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.Daniel Dunbar2010-06-071-1/+2
| | | | llvm-svn: 105580
* Frontend: Move some initialization from CompilerInstance to FrontendAction, ↵Daniel Dunbar2010-06-071-2/+8
| | | | | | 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/+2
| | | | | | instead of an IsAST bool. llvm-svn: 105578
* Make Diagnostic reference-counted, which is simpler than jugglingDouglas Gregor2010-04-051-2/+2
| | | | | | maybe-ownership vs. ownership. llvm-svn: 100498
* Match MemoryBuffer API changes.Chris Lattner2010-04-051-1/+1
| | | | llvm-svn: 100484
* Clarify the ownership semantics of the Diagnostic object used byDouglas Gregor2010-04-051-1/+2
| | | | | | | | | ASTUnit. Previously, we would end up with use-after-free errors because the Diagnostic object would be creating in one place (say, CIndex) and its ownership would not be transferred into the ASTUnit. Fixes <rdar://problem/7818608>. llvm-svn: 100464
* PPCallbacks: Add hook for reaching the end of the main file, and fix ↵Daniel Dunbar2010-03-231-0/+4
| | | | | | DependencyFile to not do work in its destructor. llvm-svn: 99257
* Lowercase for consistencyKovarththanan Rajaratnam2010-03-061-1/+1
| | | | llvm-svn: 97878
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-1/+1
| | | | | | no extra safety anyway. llvm-svn: 91207
* Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; ↵Daniel Dunbar2009-12-031-4/+2
| | | | | | propogate and simplify. llvm-svn: 90379
* This patch moves the frontend timer from clang-cc into CompilerInstance.Kovarththanan Rajaratnam2009-11-291-3/+6
| | | | | | | | | | | CompilerInstance already contains various objects that are used throughout the entire run. Also addresses Daniels review comments in: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/024508.html llvm-svn: 90073
* Simplify PreprocessorOptions, it doesn't need abstracted field access.Daniel Dunbar2009-11-171-2/+2
| | | | llvm-svn: 89047
* Add FrontendAction interface, for encapsulating a "clang-cc" style action.Daniel Dunbar2009-11-141-0/+225
llvm-svn: 88772
OpenPOWER on IntegriCloud