diff options
author | Chris Lattner <sabre@nondot.org> | 2008-05-22 04:46:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-05-22 04:46:38 +0000 |
commit | ee00d04da0220d1595287af666252ced0385357e (patch) | |
tree | c6f86bdaddef46eb4e93f4c7a965bbe58efe4847 /llvm | |
parent | a87f1a568c9064a7b1aaa1495286f1c1e6cefc97 (diff) | |
download | bcm5719-llvm-ee00d04da0220d1595287af666252ced0385357e.tar.gz bcm5719-llvm-ee00d04da0220d1595287af666252ced0385357e.zip |
Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs. Testcase here:
test/CodeGen/X86/asm-indirect-mem.ll
llvm-svn: 51409
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/VMCore/InlineAsm.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/InlineAsm.cpp b/llvm/lib/VMCore/InlineAsm.cpp index d563e9557a6..5eefc8842ba 100644 --- a/llvm/lib/VMCore/InlineAsm.cpp +++ b/llvm/lib/VMCore/InlineAsm.cpp @@ -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. |