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 | 35351a95541104b3abbc8698f38d0bad560e9e27 (patch) | |
tree | 8344b31c22433ba8b1b282252d62c91ec7c81913 /clang/lib/Frontend/PCHWriter.cpp | |
parent | a682427e42ada5d97d6d3b659c63d3d9ea62a1ae (diff) | |
download | bcm5719-llvm-35351a95541104b3abbc8698f38d0bad560e9e27.tar.gz bcm5719-llvm-35351a95541104b3abbc8698f38d0bad560e9e27.zip |
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.
llvm-svn: 94968
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 9909c95847e..caf1ce47a18 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/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 |