Changeset View
Changeset View
Standalone View
Standalone View
lib/Transforms/Utils/ModuleUtils.cpp
Show All 36 Lines | if (Constant *Init = GVCtor->getInitializer()) { | ||||
CurrentCtors.push_back(cast<Constant>(Init->getOperand(i))); | CurrentCtors.push_back(cast<Constant>(Init->getOperand(i))); | ||||
} | } | ||||
GVCtor->eraseFromParent(); | GVCtor->eraseFromParent(); | ||||
} | } | ||||
// Build a 3 field global_ctor entry. We don't take a comdat key. | // Build a 3 field global_ctor entry. We don't take a comdat key. | ||||
Constant *CSVals[3]; | Constant *CSVals[3]; | ||||
CSVals[0] = IRB.getInt32(Priority); | CSVals[0] = IRB.getInt32(Priority); | ||||
CSVals[1] = F; | CSVals[1] = ConstantExpr::getBitCast(F, FnTy); | ||||
rnk: This is probably not quite right, it should probably be a pointer to function type. | |||||
CSVals[2] = Data ? ConstantExpr::getPointerCast(Data, IRB.getInt8PtrTy()) | CSVals[2] = Data ? ConstantExpr::getPointerCast(Data, IRB.getInt8PtrTy()) | ||||
: Constant::getNullValue(IRB.getInt8PtrTy()); | : Constant::getNullValue(IRB.getInt8PtrTy()); | ||||
Constant *RuntimeCtorInit = | Constant *RuntimeCtorInit = | ||||
ConstantStruct::get(EltTy, makeArrayRef(CSVals, EltTy->getNumElements())); | ConstantStruct::get(EltTy, makeArrayRef(CSVals, EltTy->getNumElements())); | ||||
CurrentCtors.push_back(RuntimeCtorInit); | CurrentCtors.push_back(RuntimeCtorInit); | ||||
// Create a new initializer. | // Create a new initializer. | ||||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |
This is probably not quite right, it should probably be a pointer to function type.