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
This commit is contained in:
Douglas Gregor
2009-04-21 17:11:58 +00:00
parent 69223bb7f5
commit beecd58e21
12 changed files with 103 additions and 63 deletions

View File

@@ -83,6 +83,13 @@ namespace {
if (Builder)
Builder->Release();
};
virtual void CompleteTentativeDefinition(VarDecl *D) {
if (Diags.hasErrorOccurred())
return;
Builder->EmitTentativeDefinition(D);
}
};
}