diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-06-07 19:05:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-06-07 19:05:06 +0000 |
commit | a3bba3371aef2d05d3c14f959231fdcef7d482da (patch) | |
tree | 3d9831ecb6fada64a1d7cb37085085618aa92472 /llvm/lib/Target/MSIL/MSILWriter.cpp | |
parent | a54062ef0ce083355c61fcf48afda49eb6cf7aed (diff) | |
download | bcm5719-llvm-a3bba3371aef2d05d3c14f959231fdcef7d482da.tar.gz bcm5719-llvm-a3bba3371aef2d05d3c14f959231fdcef7d482da.zip |
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.
llvm-svn: 105539
Diffstat (limited to 'llvm/lib/Target/MSIL/MSILWriter.cpp')
-rw-r--r-- | llvm/lib/Target/MSIL/MSILWriter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/MSIL/MSILWriter.cpp b/llvm/lib/Target/MSIL/MSILWriter.cpp index 3de173cc26c..4b0aaa7c49a 100644 --- a/llvm/lib/Target/MSIL/MSILWriter.cpp +++ b/llvm/lib/Target/MSIL/MSILWriter.cpp @@ -845,10 +845,11 @@ void MSILWriter::printCallInstruction(const Instruction* Inst) { // Handle intrinsic function. printIntrinsicCall(cast<IntrinsicInst>(Inst)); } else { + const CallInst *CI = cast<CallInst>(Inst); // Load arguments to stack and call function. - for (int I = 1, E = Inst->getNumOperands(); I!=E; ++I) - printValueLoad(Inst->getOperand(I)); - printFunctionCall(Inst->getOperand(0),Inst); + for (int I = 0, E = CI->getNumArgOperands(); I!=E; ++I) + printValueLoad(CI->getArgOperand(I)); + printFunctionCall(CI->getCalledFunction(), Inst); } } @@ -1002,8 +1003,8 @@ void MSILWriter::printInvokeInstruction(const InvokeInst* Inst) { std::string Label = "leave$normal_"+utostr(getUniqID()); Out << ".try {\n"; // Load arguments - for (int I = 3, E = Inst->getNumOperands(); I!=E; ++I) - printValueLoad(Inst->getOperand(I)); + for (int I = 0, E = Inst->getNumArgOperands(); I!=E; ++I) + printValueLoad(Inst->getArgOperand(I)); // Print call instruction printFunctionCall(Inst->getOperand(0),Inst); // Save function result and leave "try" block |