mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Create new accessors to get arguments for call/invoke instructions. It breaks
encapsulation to force the users of these classes to know about the internal data structure of the Operands structure. It also can lead to errors, like in the MSIL writer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1150,16 +1150,18 @@ namespace {
|
||||
const InvokeInst* inv = cast<InvokeInst>(I);
|
||||
Out << "std::vector<Value*> " << iName << "_params;";
|
||||
nl(Out);
|
||||
for (unsigned i = 0; i < inv->getNumOperands() - 3; ++i) {
|
||||
for (unsigned i = 0; i < inv->getNumArgOperands(); ++i) {
|
||||
Out << iName << "_params.push_back("
|
||||
<< opNames[i] << ");";
|
||||
<< getOpName(inv->getArgOperand(i)) << ");";
|
||||
nl(Out);
|
||||
}
|
||||
// FIXME: This shouldn't use magic numbers -3, -2, and -1.
|
||||
Out << "InvokeInst *" << iName << " = InvokeInst::Create("
|
||||
<< opNames[Ops - 3] << ", "
|
||||
<< opNames[Ops - 2] << ", "
|
||||
<< opNames[Ops - 1] << ", "
|
||||
<< iName << "_params.begin(), " << iName << "_params.end(), \"";
|
||||
<< getOpName(inv->getCalledFunction()) << ", "
|
||||
<< getOpName(inv->getNormalDest()) << ", "
|
||||
<< getOpName(inv->getUnwindDest()) << ", "
|
||||
<< iName << "_params.begin(), "
|
||||
<< iName << "_params.end(), \"";
|
||||
printEscapedString(inv->getName());
|
||||
Out << "\", " << bbname << ");";
|
||||
nl(Out) << iName << "->setCallingConv(";
|
||||
|
Reference in New Issue
Block a user