Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Merge from mainline.
Browse files Browse the repository at this point in the history
Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here:
test/CodeGen/X86/asm-indirect-mem.ll



git-svn-id: http://llvm.org/svn/llvm-project/llvm/branches/release_23@51415 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Tanya Lattner committed May 22, 2008
1 parent 2b9441b commit ee2ff15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/VMCore/InlineAsm.cpp
Expand Up @@ -183,15 +183,18 @@ bool InlineAsm::Verify(const FunctionType *Ty, const std::string &ConstStr) {
if (Constraints.empty() && !ConstStr.empty()) return false;

unsigned NumOutputs = 0, NumInputs = 0, NumClobbers = 0;
unsigned NumIndirect = 0;

for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
switch (Constraints[i].Type) {
case InlineAsm::isOutput:
if ((NumInputs-NumIndirect) != 0 || NumClobbers != 0)
return false; // outputs before inputs and clobbers.
if (!Constraints[i].isIndirect) {
if (NumInputs || NumClobbers) return false; // outputs come first.
++NumOutputs;
break;
}
++NumIndirect;
// FALLTHROUGH for Indirect Outputs.
case InlineAsm::isInput:
if (NumClobbers) return false; // inputs before clobbers.
Expand Down

0 comments on commit ee2ff15

Please sign in to comment.