[ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161518 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 2894720..e5ff75e 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -585,14 +585,19 @@
MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
bool issimple, bool isvolatile, ArrayRef<Token> asmtoks,
- std::string &asmstr, SourceLocation endloc)
+ ArrayRef<unsigned> lineends, std::string &asmstr,
+ SourceLocation endloc)
: Stmt(MSAsmStmtClass), AsmLoc(asmloc), EndLoc(endloc),
AsmStr(asmstr), IsSimple(issimple), IsVolatile(isvolatile),
- NumAsmToks(asmtoks.size()) {
+ NumAsmToks(asmtoks.size()), NumLineEnds(lineends.size()) {
AsmToks = new (C) Token[NumAsmToks];
for (unsigned i = 0, e = NumAsmToks; i != e; ++i)
AsmToks[i] = asmtoks[i];
+
+ LineEnds = new (C) unsigned[NumLineEnds];
+ for (unsigned i = 0, e = NumLineEnds; i != e; ++i)
+ LineEnds[i] = lineends[i];
}
ObjCForCollectionStmt::ObjCForCollectionStmt(Stmt *Elem, Expr *Collect,