[ms-inline asm] Move some logic around to simplify the interface between the
front-end and the AsmParser. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166063 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index db13f67..eafcf92 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -673,30 +673,24 @@
MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
SourceLocation lbraceloc, bool issimple, bool isvolatile,
- ArrayRef<Token> asmtoks, ArrayRef<IdentifierInfo*> inputs,
- ArrayRef<IdentifierInfo*> outputs,
- ArrayRef<Expr*> inputexprs, ArrayRef<Expr*> outputexprs,
- StringRef asmstr, ArrayRef<StringRef> constraints,
- ArrayRef<StringRef> clobbers, SourceLocation endloc)
- : AsmStmt(MSAsmStmtClass, asmloc, issimple, isvolatile, outputs.size(),
- inputs.size(), clobbers.size()), LBraceLoc(lbraceloc),
+ ArrayRef<Token> asmtoks, unsigned numoutputs,
+ unsigned numinputs, ArrayRef<IdentifierInfo*> names,
+ ArrayRef<StringRef> constraints, ArrayRef<Expr*> exprs,
+ StringRef asmstr, ArrayRef<StringRef> clobbers,
+ SourceLocation endloc)
+ : AsmStmt(MSAsmStmtClass, asmloc, issimple, isvolatile, numoutputs,
+ numinputs, clobbers.size()), LBraceLoc(lbraceloc),
EndLoc(endloc), AsmStr(asmstr.str()), NumAsmToks(asmtoks.size()) {
- assert (inputs.size() == inputexprs.size() && "Input expr size mismatch!");
- assert (outputs.size() == outputexprs.size() && "Input expr size mismatch!");
unsigned NumExprs = NumOutputs + NumInputs;
Names = new (C) IdentifierInfo*[NumExprs];
- for (unsigned i = 0, e = NumOutputs; i != e; ++i)
- Names[i] = outputs[i];
- for (unsigned i = NumOutputs, j = 0, e = NumExprs; i != e; ++i, ++j)
- Names[i] = inputs[j];
+ for (unsigned i = 0, e = NumExprs; i != e; ++i)
+ Names[i] = names[i];
Exprs = new (C) Stmt*[NumExprs];
- for (unsigned i = 0, e = NumOutputs; i != e; ++i)
- Exprs[i] = outputexprs[i];
- for (unsigned i = NumOutputs, j = 0, e = NumExprs; i != e; ++i, ++j)
- Exprs[i] = inputexprs[j];
+ for (unsigned i = 0, e = NumExprs; i != e; ++i)
+ Exprs[i] = exprs[i];
AsmToks = new (C) Token[NumAsmToks];
for (unsigned i = 0, e = NumAsmToks; i != e; ++i)