mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-08 19:46:39 +00:00
Use the Create static method for some of these objects. They no longer
have public constructors. This should fix PR2246. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4af6ad3789
commit
480311b548
@ -1083,13 +1083,13 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
switch (I->getOpcode()) {
|
switch (I->getOpcode()) {
|
||||||
case Instruction::Ret: {
|
case Instruction::Ret: {
|
||||||
const ReturnInst* ret = cast<ReturnInst>(I);
|
const ReturnInst* ret = cast<ReturnInst>(I);
|
||||||
Out << "new ReturnInst("
|
Out << "ReturnInst::Create("
|
||||||
<< (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");";
|
<< (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Instruction::Br: {
|
case Instruction::Br: {
|
||||||
const BranchInst* br = cast<BranchInst>(I);
|
const BranchInst* br = cast<BranchInst>(I);
|
||||||
Out << "new BranchInst(" ;
|
Out << "BranchInst::Create(" ;
|
||||||
if (br->getNumOperands() == 3 ) {
|
if (br->getNumOperands() == 3 ) {
|
||||||
Out << opNames[0] << ", "
|
Out << opNames[0] << ", "
|
||||||
<< opNames[1] << ", "
|
<< opNames[1] << ", "
|
||||||
@ -1105,7 +1105,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
}
|
}
|
||||||
case Instruction::Switch: {
|
case Instruction::Switch: {
|
||||||
const SwitchInst* sw = cast<SwitchInst>(I);
|
const SwitchInst* sw = cast<SwitchInst>(I);
|
||||||
Out << "SwitchInst* " << iName << " = new SwitchInst("
|
Out << "SwitchInst* " << iName << " = SwitchInst::Create("
|
||||||
<< opNames[0] << ", "
|
<< opNames[0] << ", "
|
||||||
<< opNames[1] << ", "
|
<< opNames[1] << ", "
|
||||||
<< sw->getNumCases() << ", " << bbname << ");";
|
<< sw->getNumCases() << ", " << bbname << ");";
|
||||||
@ -1127,7 +1127,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
<< opNames[i] << ");";
|
<< opNames[i] << ");";
|
||||||
nl(Out);
|
nl(Out);
|
||||||
}
|
}
|
||||||
Out << "InvokeInst *" << iName << " = new InvokeInst("
|
Out << "InvokeInst *" << iName << " = InvokeInst::Create("
|
||||||
<< opNames[0] << ", "
|
<< opNames[0] << ", "
|
||||||
<< opNames[1] << ", "
|
<< opNames[1] << ", "
|
||||||
<< opNames[2] << ", "
|
<< opNames[2] << ", "
|
||||||
@ -1291,7 +1291,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
case Instruction::GetElementPtr: {
|
case Instruction::GetElementPtr: {
|
||||||
const GetElementPtrInst* gep = cast<GetElementPtrInst>(I);
|
const GetElementPtrInst* gep = cast<GetElementPtrInst>(I);
|
||||||
if (gep->getNumOperands() <= 2) {
|
if (gep->getNumOperands() <= 2) {
|
||||||
Out << "GetElementPtrInst* " << iName << " = new GetElementPtrInst("
|
Out << "GetElementPtrInst* " << iName << " = GetElementPtrInst::Create("
|
||||||
<< opNames[0];
|
<< opNames[0];
|
||||||
if (gep->getNumOperands() == 2)
|
if (gep->getNumOperands() == 2)
|
||||||
Out << ", " << opNames[1];
|
Out << ", " << opNames[1];
|
||||||
@ -1303,7 +1303,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
<< opNames[i] << ");";
|
<< opNames[i] << ");";
|
||||||
nl(Out);
|
nl(Out);
|
||||||
}
|
}
|
||||||
Out << "Instruction* " << iName << " = new GetElementPtrInst("
|
Out << "Instruction* " << iName << " = GetElementPtrInst::Create("
|
||||||
<< opNames[0] << ", " << iName << "_indices.begin(), "
|
<< opNames[0] << ", " << iName << "_indices.begin(), "
|
||||||
<< iName << "_indices.end()";
|
<< iName << "_indices.end()";
|
||||||
}
|
}
|
||||||
@ -1382,14 +1382,14 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
Out << iName << "_params.push_back(" << opNames[i] << ");";
|
Out << iName << "_params.push_back(" << opNames[i] << ");";
|
||||||
nl(Out);
|
nl(Out);
|
||||||
}
|
}
|
||||||
Out << "CallInst* " << iName << " = new CallInst("
|
Out << "CallInst* " << iName << " = CallInst::Create("
|
||||||
<< opNames[0] << ", " << iName << "_params.begin(), "
|
<< opNames[0] << ", " << iName << "_params.begin(), "
|
||||||
<< iName << "_params.end(), \"";
|
<< iName << "_params.end(), \"";
|
||||||
} else if (call->getNumOperands() == 2) {
|
} else if (call->getNumOperands() == 2) {
|
||||||
Out << "CallInst* " << iName << " = new CallInst("
|
Out << "CallInst* " << iName << " = CallInst::Create("
|
||||||
<< opNames[0] << ", " << opNames[1] << ", \"";
|
<< opNames[0] << ", " << opNames[1] << ", \"";
|
||||||
} else {
|
} else {
|
||||||
Out << "CallInst* " << iName << " = new CallInst(" << opNames[0]
|
Out << "CallInst* " << iName << " = CallInst::Create(" << opNames[0]
|
||||||
<< ", \"";
|
<< ", \"";
|
||||||
}
|
}
|
||||||
printEscapedString(call->getName());
|
printEscapedString(call->getName());
|
||||||
@ -1407,7 +1407,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
}
|
}
|
||||||
case Instruction::Select: {
|
case Instruction::Select: {
|
||||||
const SelectInst* sel = cast<SelectInst>(I);
|
const SelectInst* sel = cast<SelectInst>(I);
|
||||||
Out << "SelectInst* " << getCppName(sel) << " = new SelectInst(";
|
Out << "SelectInst* " << getCppName(sel) << " = SelectInst::Create(";
|
||||||
Out << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \"";
|
Out << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \"";
|
||||||
printEscapedString(sel->getName());
|
printEscapedString(sel->getName());
|
||||||
Out << "\", " << bbname << ");";
|
Out << "\", " << bbname << ");";
|
||||||
@ -1439,7 +1439,7 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) {
|
|||||||
case Instruction::InsertElement: {
|
case Instruction::InsertElement: {
|
||||||
const InsertElementInst* iei = cast<InsertElementInst>(I);
|
const InsertElementInst* iei = cast<InsertElementInst>(I);
|
||||||
Out << "InsertElementInst* " << getCppName(iei)
|
Out << "InsertElementInst* " << getCppName(iei)
|
||||||
<< " = new InsertElementInst(" << opNames[0]
|
<< " = InsertElementInst::Create(" << opNames[0]
|
||||||
<< ", " << opNames[1] << ", " << opNames[2] << ", \"";
|
<< ", " << opNames[1] << ", " << opNames[2] << ", \"";
|
||||||
printEscapedString(iei->getName());
|
printEscapedString(iei->getName());
|
||||||
Out << "\", " << bbname << ");";
|
Out << "\", " << bbname << ");";
|
||||||
@ -1550,7 +1550,7 @@ void CppWriter::printFunctionHead(const Function* F) {
|
|||||||
nl(Out) << "if (!" << getCppName(F) << ") {";
|
nl(Out) << "if (!" << getCppName(F) << ") {";
|
||||||
nl(Out) << getCppName(F);
|
nl(Out) << getCppName(F);
|
||||||
}
|
}
|
||||||
Out<< " = new Function(";
|
Out<< " = Function::Create(";
|
||||||
nl(Out,1) << "/*Type=*/" << getCppName(F->getFunctionType()) << ",";
|
nl(Out,1) << "/*Type=*/" << getCppName(F->getFunctionType()) << ",";
|
||||||
nl(Out) << "/*Linkage=*/";
|
nl(Out) << "/*Linkage=*/";
|
||||||
printLinkageType(F->getLinkage());
|
printLinkageType(F->getLinkage());
|
||||||
@ -1628,7 +1628,7 @@ void CppWriter::printFunctionBody(const Function *F) {
|
|||||||
for (Function::const_iterator BI = F->begin(), BE = F->end();
|
for (Function::const_iterator BI = F->begin(), BE = F->end();
|
||||||
BI != BE; ++BI) {
|
BI != BE; ++BI) {
|
||||||
std::string bbname(getCppName(BI));
|
std::string bbname(getCppName(BI));
|
||||||
Out << "BasicBlock* " << bbname << " = new BasicBlock(\"";
|
Out << "BasicBlock* " << bbname << " = BasicBlock::Create(\"";
|
||||||
if (BI->hasName())
|
if (BI->hasName())
|
||||||
printEscapedString(BI->getName());
|
printEscapedString(BI->getName());
|
||||||
Out << "\"," << getCppName(BI->getParent()) << ",0);";
|
Out << "\"," << getCppName(BI->getParent()) << ",0);";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user