summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTMerge.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When building a module, forward diagnostics to the outer diagnostic consumer.Douglas Gregor2013-05-031-3/+4
| | | | | | | | | | | | | | | Previously, we would clone the current diagnostic consumer to produce a new diagnostic consumer to use when building a module. The problem here is that we end up losing diagnostics for important diagnostic consumers, such as serialized diagnostics (where we'd end up with two diagnostic consumers writing the same output file). With forwarding, the diagnostics from all of the different modules being built get forwarded to the one serialized-diagnostic consumer and are emitted in a sane way. Fixes <rdar://problem/13663996>. llvm-svn: 181067
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-2/+3
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-2/+2
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Use variable in place of multiple CI.getFrontendOpts() calls and use a bitArgyrios Kyrtzidis2012-02-041-2/+2
| | | | | | of ArrayRef goodness. No functionality change. llvm-svn: 149739
* Extract the (InputKind, std::string) pair used to describe inputs toDouglas Gregor2012-01-201-2/+1
| | | | | | | the front end into its own class, FrontendInputFile, to make it easier to introduce new per-input data. No functionality change. llvm-svn: 148546
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+2
| | | | llvm-svn: 140478
* 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
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Introduce the notion of a "minimal" import of ASTs, to better support LLDB.Douglas Gregor2011-01-181-1/+2
| | | | llvm-svn: 123723
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-3/+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
* Since multiple diagnostics can share one diagnostic client, have the client ↵Argyrios Kyrtzidis2010-11-181-9/+0
| | | | | | | | keeping track of the total number of warnings/errors reported. llvm-svn: 119731
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-181-9/+15
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-2/+5
| | | | | | | | | | | | | | | | | | | 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
* More PCH -> AST renaming.Sebastian Redl2010-08-181-2/+2
| | | | llvm-svn: 111472
* Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor2010-08-131-0/+6
| | | | | | | | used when parsing (or re-parsing) a file. Also, when loading a precompiled header into ASTUnit, create a Sema object that holds onto semantic-analysis information. llvm-svn: 111003
* FrontendAction: Track active file kind.Daniel Dunbar2010-06-071-1/+2
| | | | llvm-svn: 105581
* Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.Daniel Dunbar2010-06-071-2/+2
| | | | llvm-svn: 105580
* Make Diagnostic reference-counted, which is simpler than jugglingDouglas Gregor2010-04-051-3/+3
| | | | | | maybe-ownership vs. ownership. llvm-svn: 100498
* 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
* ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support ↵Daniel Dunbar2010-02-161-1/+1
| | | | | | this as an argument. llvm-svn: 96316
* Don't import __va_list_tag or __builtin_va_list when mergingDouglas Gregor2010-02-161-0/+6
| | | | llvm-svn: 96299
* Tell ASTMerge to merge every declaration it sees, rather than cherry-picking ↵Douglas Gregor2010-02-151-15/+1
| | | | | | those declarations that we know will work. llvm-svn: 96280
* When AST merging for record declarations fails, warn about theDouglas Gregor2010-02-111-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | incompatibility and show where the structural differences are. For example: struct1.c:36:8: warning: type 'struct S7' has incompatible definitions in different translation units struct S7 { int i : 8; unsigned j : 8; } x7; ^ struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here struct S7 { int i : 8; unsigned j : 8; } x7; ^ struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here struct S7 { int i : 8; unsigned j : 16; } x7; ^ There are a few changes to make this work: - ASTImporter now has only a single Diagnostic object, not multiple diagnostic objects. Otherwise, having a warning/error printed via one Diagnostic and its note printed on the other Diagnostic could cause the note to be suppressed. - Implemented import functionality for IntegerLiteral (along with general support for statements and expressions) llvm-svn: 95900
* Implement basic support for merging function declarations acrossDouglas Gregor2010-02-101-3/+10
| | | | | | translation units. llvm-svn: 95794
* Teach AST merging that variables with incomplete array types can beDouglas Gregor2010-02-101-2/+4
| | | | | | | | merged with variables of constant array types. Also, make sure that we call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has a LangOptions to work with. llvm-svn: 95782
* Implement basic support for importing source locations from one ASTDouglas Gregor2010-02-101-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | into another AST, including their include history. Here's an example error that involves a conflict merging a variable with different types in two translation units (diagnosed in the third AST context into which everything is merged). /Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5: error: external variable 'x2' declared with incompatible types in different translation units ('int' vs. 'double') int x2; ^ In file included from /Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3: /Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8: note: declared here with type 'double' double x2; ^ Although we maintain include history, we do not maintain macro instantiation history across a merge. Instead, we map down to the spelling location (for now!). llvm-svn: 95732
* Hook up the diagnostics-argument printer when merging AST files, soDouglas Gregor2010-02-091-5/+10
| | | | | | | | | | | that we get readable diagnostics such as: error: external variable 'x1' declared with incompatible types in different translation units ('double *' vs. 'float **') However, there is no translation of source locations, yet. llvm-svn: 95704
* Introduce a testbed for merging multiple ASTs into a single ASTDouglas Gregor2010-02-091-0/+98
context with the AST importer. WIP, still useless but at least it has a test. llvm-svn: 95683
OpenPOWER on IntegriCloud