summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-21 17:11:58 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-21 17:11:58 +0000
commitbeecd58e21ec458d543bd5ae332d8358578d0251 (patch)
tree654a2a949dcdb3e8f42d560070b8f2035d613fd8 /clang/lib/CodeGen/ModuleBuilder.cpp
parent69223bb7f5a99de5d6acdbb5e79bf9bc2ab6faca (diff)
downloadbcm5719-llvm-beecd58e21ec458d543bd5ae332d8358578d0251.tar.gz
bcm5719-llvm-beecd58e21ec458d543bd5ae332d8358578d0251.zip
Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the translation unit. Eliminate CodeGen's internal tracking of tentative definitions, and instead hook into ASTConsumer::CompleteTentativeDefinition. Also, tweak the definition-deferal logic for C++, where there are no tentative definitions. Fixes <rdar://problem/6808352>, and will make it much easier for precompiled headers to cope with tentative definitions in the future. llvm-svn: 69681
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r--clang/lib/CodeGen/ModuleBuilder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp
index 896464ed5a8..9b85df61da0 100644
--- a/clang/lib/CodeGen/ModuleBuilder.cpp
+++ b/clang/lib/CodeGen/ModuleBuilder.cpp
@@ -83,6 +83,13 @@ namespace {
if (Builder)
Builder->Release();
};
+
+ virtual void CompleteTentativeDefinition(VarDecl *D) {
+ if (Diags.hasErrorOccurred())
+ return;
+
+ Builder->EmitTentativeDefinition(D);
+ }
};
}
OpenPOWER on IntegriCloud