[llvm-commits] CVS: llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp
Joel Stanley
jstanley at cs.uiuc.edu
Tue May 13 14:44:00 PDT 2003
Changes in directory llvm/lib/Reoptimizer/Inst/lib/Phase1:
PrimInfo.cpp updated: 1.14 -> 1.15
---
Log message:
Old alloca-finding code removed; code cleanup.
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp
diff -u llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp:1.14 llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp:1.15
--- llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp:1.14 Tue May 13 13:36:34 2003
+++ llvm/lib/Reoptimizer/Inst/lib/Phase1/PrimInfo.cpp Tue May 13 14:43:03 2003
@@ -96,17 +96,12 @@
assert(!init && "Expect only one invocation of this function");
init = true;
-
- std::vector<const Type*> fields;
- fields.push_back(Type::UIntTy); // unsigned gbtType;
- fields.push_back(PointerType::get(Type::UShortTy)); // unsigned short* loadVar;
- fields.push_back(Type::UIntTy); // unsigned gbtStartIdx;
- fields.push_back(Type::UIntTy); // unsigned paramSize;
- fields.push_back(PointerType::get(Type::VoidTy)); // void* retVal;
- fields.push_back(PointerType::get(Type::VoidTy)); // void* instFunc;
-
- sm_structType = StructType::get(fields);
+ PointerType* uspt = PointerType::get(Type::UShortTy);
+ PointerType* vpt = PointerType::get(Type::VoidTy);
+ sm_structType =
+ StructType::get(make_vector<const Type*>(
+ Type::UIntTy, uspt, Type::UIntTy, Type::UIntTy, vpt, vpt, 0));
module->addTypeName("PrimInfo", sm_structType);
}
@@ -118,15 +113,15 @@
unsigned paramSize,
Function* instFunc)
{
- std::vector<Constant*> inits;
- inits.push_back(ConstantUInt::get(Type::UIntTy, gbtType));
- inits.push_back(ConstantPointerRef::get(loadVar));
- inits.push_back(ConstantUInt::get(Type::UIntTy, (unsigned) 0));
- inits.push_back(ConstantUInt::get(Type::UIntTy, paramSize));
- inits.push_back(Constant::getNullValue(PointerType::get(Type::VoidTy)));
- inits.push_back(ConstantExpr::getCast(ConstantPointerRef::get(instFunc),
- PointerType::get(Type::VoidTy)));
- return ConstantStruct::get(st, inits);
+ std::vector<Constant*> init;
+ init.push_back(ConstantUInt::get(Type::UIntTy, gbtType));
+ init.push_back(ConstantPointerRef::get(loadVar));
+ init.push_back(ConstantUInt::get(Type::UIntTy, 0));
+ init.push_back(ConstantUInt::get(Type::UIntTy, paramSize));
+ init.push_back(Constant::getNullValue(PointerType::get(Type::VoidTy)));
+ init.push_back(ConstantExpr::getCast(ConstantPointerRef::get(instFunc),
+ PointerType::get(Type::VoidTy)));
+ return ConstantStruct::get(st, init);
}
// For non-start sites
@@ -138,16 +133,16 @@
GlobalVariable* metricVar,
Function* instFunc)
{
- std::vector<Constant*> inits;
- inits.push_back(ConstantUInt::get(Type::UIntTy, gbtType));
- inits.push_back(ConstantPointerRef::get(loadVar));
- inits.push_back(ConstantUInt::get(Type::UIntTy, startLinkIdx));
- inits.push_back(ConstantUInt::get(Type::UIntTy, paramSize));
- inits.push_back(ConstantExpr::getCast(ConstantPointerRef::get(metricVar),
- PointerType::get(Type::VoidTy)));
- inits.push_back(ConstantExpr::getCast(ConstantPointerRef::get(instFunc),
- PointerType::get(Type::VoidTy)));
- return ConstantStruct::get(st, inits);
+ std::vector<Constant*> init;
+ init.push_back(ConstantUInt::get(Type::UIntTy, gbtType));
+ init.push_back(ConstantPointerRef::get(loadVar));
+ init.push_back(ConstantUInt::get(Type::UIntTy, startLinkIdx));
+ init.push_back(ConstantUInt::get(Type::UIntTy, paramSize));
+ init.push_back(ConstantExpr::getCast(ConstantPointerRef::get(metricVar),
+ PointerType::get(Type::VoidTy)));
+ init.push_back(ConstantExpr::getCast(ConstantPointerRef::get(instFunc),
+ PointerType::get(Type::VoidTy)));
+ return ConstantStruct::get(st, init);
}
void PrimInfo::buildStructInstances(std::vector<Constant*>& gbtElems,
More information about the llvm-commits
mailing list