aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-01-31 22:27:38 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-01-31 22:27:38 +0000
commite9d12b6c50c1e9b05443db099e21026c5991a93b (patch)
treea750984a3b4a4624cc6dd6a27fcaf030ea010db0 /lib/Frontend/PCHWriter.cpp
parent6997aae42800d95a1189a6186af438feb19ecc54 (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/PCHWriter.cpp')
-rw-r--r--lib/Frontend/PCHWriter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 9909c95847..caf1ce47a1 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -1960,13 +1960,11 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
}
// Build a record containing all of the tentative definitions in this file, in
- // TentativeDefinitionList order. Generally, this record will be empty for
+ // TentativeDefinitions order. Generally, this record will be empty for
// headers.
RecordData TentativeDefinitions;
- for (unsigned i = 0, e = SemaRef.TentativeDefinitionList.size(); i != e; ++i){
- VarDecl *VD =
- SemaRef.TentativeDefinitions.lookup(SemaRef.TentativeDefinitionList[i]);
- if (VD) AddDeclRef(VD, TentativeDefinitions);
+ for (unsigned i = 0, e = SemaRef.TentativeDefinitions.size(); i != e; ++i) {
+ AddDeclRef(SemaRef.TentativeDefinitions[i], TentativeDefinitions);
}
// Build a record containing all of the locally-scoped external