diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-01-31 22:27:38 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-01-31 22:27:38 +0000 |
commit | e9d12b6c50c1e9b05443db099e21026c5991a93b (patch) | |
tree | a750984a3b4a4624cc6dd6a27fcaf030ea010db0 /lib/Frontend/PCHReader.cpp | |
parent | 6997aae42800d95a1189a6186af438feb19ecc54 (diff) |
Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 259355145a..bd93cf6b08 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -2464,11 +2464,10 @@ void PCHReader::InitializeSema(Sema &S) { PreloadedDecls.clear(); // If there were any tentative definitions, deserialize them and add - // them to Sema's table of tentative definitions. + // them to Sema's list of tentative definitions. for (unsigned I = 0, N = TentativeDefinitions.size(); I != N; ++I) { VarDecl *Var = cast<VarDecl>(GetDecl(TentativeDefinitions[I])); - SemaObj->TentativeDefinitions[Var->getDeclName()] = Var; - SemaObj->TentativeDefinitionList.push_back(Var->getDeclName()); + SemaObj->TentativeDefinitions.push_back(Var); } // If there were any locally-scoped external declarations, |