aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ASTMerge.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-08-13Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor1-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
2010-06-07FrontendAction: Track active file kind.Daniel Dunbar1-1/+2
llvm-svn: 105581
2010-06-07Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.Daniel Dunbar1-2/+2
llvm-svn: 105580
2010-04-05Make Diagnostic reference-counted, which is simpler than jugglingDouglas Gregor1-3/+3
maybe-ownership vs. ownership. llvm-svn: 100498
2010-04-05Clarify the ownership semantics of the Diagnostic object used byDouglas Gregor1-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
2010-02-16ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support ↵Daniel Dunbar1-1/+1
this as an argument. llvm-svn: 96316
2010-02-16Don't import __va_list_tag or __builtin_va_list when mergingDouglas Gregor1-0/+6
llvm-svn: 96299
2010-02-15Tell ASTMerge to merge every declaration it sees, rather than cherry-picking ↵Douglas Gregor1-15/+1
those declarations that we know will work. llvm-svn: 96280
2010-02-11When AST merging for record declarations fails, warn about theDouglas Gregor1-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
2010-02-10Implement basic support for merging function declarations acrossDouglas Gregor1-3/+10
translation units. llvm-svn: 95794
2010-02-10Teach AST merging that variables with incomplete array types can beDouglas Gregor1-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
2010-02-10Implement basic support for importing source locations from one ASTDouglas Gregor1-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
2010-02-09Hook up the diagnostics-argument printer when merging AST files, soDouglas Gregor1-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
2010-02-09Introduce a testbed for merging multiple ASTs into a single ASTDouglas Gregor1-0/+98
context with the AST importer. WIP, still useless but at least it has a test. llvm-svn: 95683