Skip to content

Commit 9c108f4

Browse files
committed
Merge from mainline.
Fix PR2267, by allowing indirect outputs to be intermixed with normal outputs. Testcase here: test/CodeGen/X86/asm-indirect-mem.ll llvm-svn: 51415
1 parent 422c8d1 commit 9c108f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/VMCore/InlineAsm.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,18 @@ bool InlineAsm::Verify(const FunctionType *Ty, const std::string &ConstStr) {
183183
if (Constraints.empty() && !ConstStr.empty()) return false;
184184

185185
unsigned NumOutputs = 0, NumInputs = 0, NumClobbers = 0;
186+
unsigned NumIndirect = 0;
186187

187188
for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
188189
switch (Constraints[i].Type) {
189190
case InlineAsm::isOutput:
191+
if ((NumInputs-NumIndirect) != 0 || NumClobbers != 0)
192+
return false; // outputs before inputs and clobbers.
190193
if (!Constraints[i].isIndirect) {
191-
if (NumInputs || NumClobbers) return false; // outputs come first.
192194
++NumOutputs;
193195
break;
194196
}
197+
++NumIndirect;
195198
// FALLTHROUGH for Indirect Outputs.
196199
case InlineAsm::isInput:
197200
if (NumClobbers) return false; // inputs before clobbers.

0 commit comments

Comments
 (0)