aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-05-22 05:16:47 +0000
committerTanya Lattner <tonic@nondot.org>2008-05-22 05:16:47 +0000
commit4f4be876a938ef6dc53f589731e5f95c0dd5505b (patch)
treed15382d646f347550b0afa8a62921b1f8288b969
parentb80294d4e33601ae249ec0ce92e488fba6fc279a (diff)
Merge from mainline.
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/branches/release_23@51415 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/InlineAsm.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VMCore/InlineAsm.cpp b/lib/VMCore/InlineAsm.cpp
index d563e9557a..5eefc8842b 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.