Revision: 125984 Author: dpatel Date: 2007-04-11 10:29:14 -0700 (Wed, 11 Apr 2007)
Log Message: ----------- Cosmetic changes. Rename fns/variales, add comment. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-internal.h Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-11 17:17:11 UTC (rev 125983) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-11 17:29:14 UTC (rev 125984) @@ -210,7 +210,7 @@ // Read LLVM Types string table readLLVMTypesStringTable(); - readLLVMValuesStringTable(); + readLLVMValues(); flag_llvm_pch_read = 1; } @@ -432,7 +432,7 @@ if (flag_pch_file) { writeLLVMTypesStringTable(); - writeLLVMValuesStringTable(); + writeLLVMValues(); } // Add an llvm.global_ctors global if needed. Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:17:11 UTC (rev 125983) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:29:14 UTC (rev 125984) @@ -157,17 +157,17 @@ } // Read LLVM Types string table -void readLLVMValuesStringTable() { +void readLLVMValues() { GlobalValue *V = TheModule->getNamedGlobal("llvm.pch.values"); if (!V) return; GlobalVariable *GV = cast<GlobalVariable>(V); - ConstantStruct *LValueNames = cast<ConstantStruct>(GV->getOperand(0)); + ConstantStruct *ValuesFromPCH = cast<ConstantStruct>(GV->getOperand(0)); - for (unsigned i = 0; i < LValueNames->getNumOperands(); ++i) { - Value *Va = LValueNames->getOperand(i); + for (unsigned i = 0; i < ValuesFromPCH->getNumOperands(); ++i) { + Value *Va = ValuesFromPCH->getOperand(i); if (!Va) { // If V is empty then nsert NULL to represent empty entries. @@ -189,23 +189,25 @@ // GCC tree's uses LLVMValues vector's index to reach LLVM Values. // Create a string table to hold these LLVM Values' names. This string // table will be used to recreate LTypes vector after loading PCH. -void writeLLVMValuesStringTable() { +void writeLLVMValues() { if (LLVMValues.empty()) return; - std::vector<Constant *> LLVMValuesNames; + std::vector<Constant *> ValuesForPCH; for (std::vector<Value *>::iterator I = LLVMValues.begin(), E = LLVMValues.end(); I != E; ++I) { if (Constant *C = dyn_cast<Constant>(*I)) - LLVMValuesNames.push_back(C); + ValuesForPCH.push_back(C); else - LLVMValuesNames.push_back(NULL); + // Non constant values, e.g. arguments, are not at global scope. + // When PCH is read, only global scope values are used. + ValuesForPCH.push_back(NULL); } // Create string table. - Constant *LLVMValuesNameTable = ConstantStruct::get(LLVMValuesNames, false); + Constant *LLVMValuesNameTable = ConstantStruct::get(ValuesForPCH, false); // Create variable to hold this string table. new GlobalVariable(LLVMValuesNameTable->getType(), true, Modified: apple-local/branches/llvm/gcc/llvm-internal.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-11 17:17:11 UTC (rev 125983) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-11 17:29:14 UTC (rev 125984) @@ -90,8 +90,8 @@ void changeLLVMValue(Value *Old, Value *New); void readLLVMTypesStringTable(); void writeLLVMTypesStringTable(); -void readLLVMValuesStringTable(); -void writeLLVMValuesStringTable(); +void readLLVMValues(); +void writeLLVMValues(); void clearTargetBuiltinCache(); struct StructTypeConversionInfo; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits