diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-10-16 21:55:39 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-10-16 21:55:39 +0000 |
commit | e54cba1ec0b0e498ee67d200289035797932e714 (patch) | |
tree | 38436a5224768c35816c264074be2fec7bd9b582 /lib/AST/Stmt.cpp | |
parent | 4d283e1f499560654f10c9166a369fb5c1535354 (diff) |
[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
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index db13f67e90..eafcf92eee 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -673,30 +673,24 @@ GCCAsmStmt::GCCAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, 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) |