[llvm-commits] [llvm] r51438 - /llvm/branches/release_23/lib/Target/CBackend/CBackend.cpp
Tanya Lattner
tonic at nondot.org
Thu May 22 13:51:09 PDT 2008
Author: tbrethou
Date: Thu May 22 15:51:09 2008
New Revision: 51438
URL: http://llvm.org/viewvc/llvm-project?rev=51438&view=rev
Log:
Merge from mainline.
fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.
Modified:
llvm/branches/release_23/lib/Target/CBackend/CBackend.cpp
Modified: llvm/branches/release_23/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_23/lib/Target/CBackend/CBackend.cpp?rev=51438&r1=51437&r2=51438&view=diff
==============================================================================
--- llvm/branches/release_23/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/branches/release_23/lib/Target/CBackend/CBackend.cpp Thu May 22 15:51:09 2008
@@ -2935,7 +2935,7 @@
default: assert(0 && "Unknown asm constraint");
case InlineAsm::isInput: {
assert(ValueCount >= ResultVals.size() && "Input can't refer to result");
- Value *V = CI.getOperand(ValueCount-ResultVals.size());
+ Value *V = CI.getOperand(ValueCount-ResultVals.size()+1);
Input.push_back(std::make_pair(C, V));
break;
}
@@ -2944,7 +2944,7 @@
if (ValueCount < ResultVals.size())
V = ResultVals[ValueCount];
else
- V = std::make_pair(CI.getOperand(ValueCount-ResultVals.size()), -1);
+ V = std::make_pair(CI.getOperand(ValueCount-ResultVals.size()+1), -1);
Output.push_back(std::make_pair("="+((I->isEarlyClobber ? "&" : "")+C),
V));
break;
@@ -2964,20 +2964,19 @@
for (unsigned i = 0, e = Output.size(); i != e; ++i) {
if (i)
Out << ", ";
- Out << "\"" << Output[i].first << "\"(";
- writeOperandRaw(Output[i].second.first);
+ Out << "\"" << Output[i].first << "\"("
+ << GetValueName(Output[i].second.first);
if (Output[i].second.second != -1)
Out << ".field" << Output[i].second.second; // Multiple retvals.
Out << ")";
}
Out << "\n :";
- for (std::vector<std::pair<std::string, Value*> >::iterator I = Input.begin(),
- E = Input.end(); I != E; ++I) {
- Out << "\"" << I->first << "\"(";
- writeOperandRaw(I->second);
+ for (unsigned i = 0, e = Input.size(); i != e; ++i) {
+ if (i)
+ Out << ", ";
+ Out << "\"" << Input[i].first << "\"(";
+ writeOperand(Input[i].second);
Out << ")";
- if (I + 1 != E)
- Out << ",";
}
if (Clobber.size())
Out << "\n :" << Clobber.substr(1);
More information about the llvm-commits
mailing list