[llvm-commits] [llvm-gcc-4.2] r58202 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Chris Lattner
sabre at nondot.org
Sun Oct 26 13:46:09 PDT 2008
Author: lattner
Date: Sun Oct 26 15:46:08 2008
New Revision: 58202
URL: http://llvm.org/viewvc/llvm-project?rev=58202&view=rev
Log:
improve some comments and fix an assert that Duncan pointed out.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=58202&r1=58201&r2=58202&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sun Oct 26 15:46:08 2008
@@ -90,8 +90,13 @@
static std::vector<Value *> LLVMValues;
typedef DenseMap<Value *, unsigned> LLVMValuesMapTy;
static LLVMValuesMapTy LLVMValuesMap;
+
/// LocalLLVMValueIDs - This is the set of local IDs we have in our mapping,
-/// this allows us to efficiently identify and remove them.
+/// this allows us to efficiently identify and remove them. Local IDs are IDs
+/// for values that are local to the current function being processed. These do
+/// not need to go into the PCH file, but DECL_LLVM still needs a valid index
+/// while converting the function. Using "Local IDs" allows the IDs for
+/// function-local decls to be recycled after the function is done.
static std::vector<unsigned> LocalLLVMValueIDs;
// Remember the LLVM value for GCC tree node.
@@ -242,7 +247,7 @@
LocalLLVMValueIDs.pop_back();
if (Value *V = LLVMValues[Idx]) {
- assert(!isa<Constant>(V) && "Found local value");
+ assert(!isa<Constant>(V) && "Found global value");
LLVMValuesMap.erase(V);
}
More information about the llvm-commits
mailing list