fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.

llvm-svn: 51422
This commit is contained in:
Chris Lattner 2008-05-22 06:29:38 +00:00
parent 79be90c3c7
commit 3d1797ccaa
1 changed files with 9 additions and 10 deletions

View File

@ -2941,7 +2941,7 @@ void CWriter::visitInlineAsm(CallInst &CI) {
default: assert(0 && "Unknown asm constraint"); default: assert(0 && "Unknown asm constraint");
case InlineAsm::isInput: { case InlineAsm::isInput: {
assert(ValueCount >= ResultVals.size() && "Input can't refer to result"); 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)); Input.push_back(std::make_pair(C, V));
break; break;
} }
@ -2950,7 +2950,7 @@ void CWriter::visitInlineAsm(CallInst &CI) {
if (ValueCount < ResultVals.size()) if (ValueCount < ResultVals.size())
V = ResultVals[ValueCount]; V = ResultVals[ValueCount];
else 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), Output.push_back(std::make_pair("="+((I->isEarlyClobber ? "&" : "")+C),
V)); V));
break; break;
@ -2970,20 +2970,19 @@ void CWriter::visitInlineAsm(CallInst &CI) {
for (unsigned i = 0, e = Output.size(); i != e; ++i) { for (unsigned i = 0, e = Output.size(); i != e; ++i) {
if (i) if (i)
Out << ", "; Out << ", ";
Out << "\"" << Output[i].first << "\"("; Out << "\"" << Output[i].first << "\"("
writeOperandRaw(Output[i].second.first); << GetValueName(Output[i].second.first);
if (Output[i].second.second != -1) if (Output[i].second.second != -1)
Out << ".field" << Output[i].second.second; // Multiple retvals. Out << ".field" << Output[i].second.second; // Multiple retvals.
Out << ")"; Out << ")";
} }
Out << "\n :"; Out << "\n :";
for (std::vector<std::pair<std::string, Value*> >::iterator I = Input.begin(), for (unsigned i = 0, e = Input.size(); i != e; ++i) {
E = Input.end(); I != E; ++I) { if (i)
Out << "\"" << I->first << "\"("; Out << ", ";
writeOperandRaw(I->second); Out << "\"" << Input[i].first << "\"(";
writeOperand(Input[i].second);
Out << ")"; Out << ")";
if (I + 1 != E)
Out << ",";
} }
if (Clobber.size()) if (Clobber.size())
Out << "\n :" << Clobber.substr(1); Out << "\n :" << Clobber.substr(1);