aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTMerge.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-10 00:15:17 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-10 00:15:17 +0000
commit885237354fd902998c6ae9d7cc3dc8de96b123dc (patch)
tree993dd13118715465d05a26c1ca414597eee4da60 /lib/Frontend/ASTMerge.cpp
parentb24b0f8cc55d34a050ce1a4722a654d56e9fd947 (diff)
Implement basic support for importing source locations from one AST
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!). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTMerge.cpp')
-rw-r--r--lib/Frontend/ASTMerge.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Frontend/ASTMerge.cpp b/lib/Frontend/ASTMerge.cpp
index e88d2953c3..d51647bb16 100644
--- a/lib/Frontend/ASTMerge.cpp
+++ b/lib/Frontend/ASTMerge.cpp
@@ -44,8 +44,12 @@ void ASTMergeAction::ExecuteAction() {
ASTDiags.SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
&Unit->getASTContext());
- ASTImporter Importer(CI.getASTContext(), CI.getDiagnostics(),
- Unit->getASTContext(), ASTDiags);
+ ASTImporter Importer(CI.getASTContext(),
+ CI.getFileManager(),
+ CI.getDiagnostics(),
+ Unit->getASTContext(),
+ Unit->getFileManager(),
+ ASTDiags);
TranslationUnitDecl *TU = Unit->getASTContext().getTranslationUnitDecl();
for (DeclContext::decl_iterator D = TU->decls_begin(),