From beecd58e21ec458d543bd5ae332d8358578d0251 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 21 Apr 2009 17:11:58 +0000 Subject: 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 , and will make it much easier for precompiled headers to cope with tentative definitions in the future. llvm-svn: 69681 --- clang/lib/CodeGen/ModuleBuilder.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp') 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); + } }; } -- cgit v1.2.3