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 | ea21ad49261a6a9d1614c01e631c2cdc4d554b84 (patch) | |
tree | 94b8900c340d2ef0bbbb91803ed3b694f461fb6d | |
parent | 9c287c2ab4533b054ede8eeaf8ee7d1007d73645 (diff) | |
download | external_llvm-ea21ad49261a6a9d1614c01e631c2cdc4d554b84.zip external_llvm-ea21ad49261a6a9d1614c01e631c2cdc4d554b84.tar.gz external_llvm-ea21ad49261a6a9d1614c01e631c2cdc4d554b84.tar.bz2 |
Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs. Testcase here:
test/CodeGen/X86/asm-indirect-mem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/InlineAsm.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VMCore/InlineAsm.cpp b/lib/VMCore/InlineAsm.cpp index d563e95..5eefc88 100644 --- a/lib/VMCore/InlineAsm.cpp +++ b/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. |