[ms-inline asm] Remove the last bits of LineEnds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161904 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 79e1920..fc0c081 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -1627,18 +1627,15 @@
   bool IsVolatile;
 
   unsigned NumAsmToks;
-  unsigned NumLineEnds;
   unsigned NumClobbers;
 
   Token *AsmToks;
-  unsigned *LineEnds;
   Stmt **Exprs;
   StringRef *Clobbers;
 
 public:
   MSAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple,
-            bool isvolatile, ArrayRef<Token> asmtoks,
-            ArrayRef<unsigned> lineends, StringRef asmstr,
+            bool isvolatile, ArrayRef<Token> asmtoks, StringRef asmstr,
             ArrayRef<StringRef> clobbers, SourceLocation endloc);
 
   SourceLocation getAsmLoc() const { return AsmLoc; }
@@ -1648,8 +1645,6 @@
 
   unsigned getNumAsmToks() { return NumAsmToks; }
   Token *getAsmToks() { return AsmToks; }
-  unsigned getNumLineEnds() { return NumLineEnds; }
-  unsigned *getLineEnds() { return LineEnds; }
 
   bool isVolatile() const { return IsVolatile; }
   void setVolatile(bool V) { IsVolatile = V; }
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 058e0d9..2cd5827 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -2543,7 +2543,6 @@
 
   StmtResult ActOnMSAsmStmt(SourceLocation AsmLoc,
                             ArrayRef<Token> AsmToks,
-                            ArrayRef<unsigned> LineEnds,
                             SourceLocation EndLoc);
 
   VarDecl *BuildObjCExceptionDecl(TypeSourceInfo *TInfo, QualType ExceptionType,
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index d877c3f..9aa7f5b 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -585,21 +585,16 @@
 
 MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
                      bool issimple, bool isvolatile, ArrayRef<Token> asmtoks,
-                     ArrayRef<unsigned> lineends, StringRef asmstr,
-                     ArrayRef<StringRef> clobbers, SourceLocation endloc)
+                     StringRef asmstr, ArrayRef<StringRef> clobbers,
+                     SourceLocation endloc)
   : Stmt(MSAsmStmtClass), AsmLoc(asmloc), EndLoc(endloc),
     AsmStr(asmstr.str()), IsSimple(issimple), IsVolatile(isvolatile),
-    NumAsmToks(asmtoks.size()), NumLineEnds(lineends.size()),
-    NumClobbers(clobbers.size()) {
+    NumAsmToks(asmtoks.size()), NumClobbers(clobbers.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];
-
   Clobbers = new (C) StringRef[NumClobbers];
   for (unsigned i = 0, e = NumClobbers; i != e; ++i) {
     // FIXME: Avoid the allocation/copy if at all possible.
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index 915a62e..0ff1c8a 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -1657,7 +1657,6 @@
   SourceManager &SrcMgr = PP.getSourceManager();
   SourceLocation EndLoc = AsmLoc;
   SmallVector<Token, 4> AsmToks;
-  SmallVector<unsigned, 4> LineEnds;
 
   bool InBraces = false;
   unsigned short savedBraceCount = 0;
@@ -1741,8 +1740,6 @@
     ++NumTokensRead;
   } while (1);
 
-  LineEnds.push_back(AsmToks.size());
-
   if (InBraces && BraceCount != savedBraceCount) {
     // __asm without closing brace (this can happen at EOF).
     Diag(Tok, diag::err_expected_rbrace);
@@ -1755,8 +1752,7 @@
   }
 
   // FIXME: We should be passing source locations for better diagnostics.
-  return Actions.ActOnMSAsmStmt(AsmLoc, llvm::makeArrayRef(AsmToks),
-                                llvm::makeArrayRef(LineEnds), EndLoc);
+  return Actions.ActOnMSAsmStmt(AsmLoc, llvm::makeArrayRef(AsmToks), EndLoc);                               
 }
 
 /// ParseAsmStatement - Parse a GNU extended asm statement.
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 5ad6e08..1c2b6a4 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -2849,7 +2849,6 @@
 
 StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
                                 ArrayRef<Token> AsmToks,
-                                ArrayRef<unsigned> LineEnds,
                                 SourceLocation EndLoc) {
   // MS-style inline assembly is not fully supported, so emit a warning.
   Diag(AsmLoc, diag::warn_unsupported_msasm);
@@ -2860,8 +2859,8 @@
     StringRef AsmString;
     MSAsmStmt *NS =
       new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true,
-                              /* IsVolatile */ true, AsmToks, LineEnds,
-                              AsmString, Clobbers, EndLoc);
+                              /* IsVolatile */ true, AsmToks, AsmString,
+                              Clobbers, EndLoc);
     return Owned(NS);
   }
 
@@ -2886,8 +2885,8 @@
   if (!IsSimple) {
     MSAsmStmt *NS =
       new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true,
-                              /* IsVolatile */ true, AsmToks, LineEnds,
-                              AsmString, Clobbers, EndLoc);
+                              /* IsVolatile */ true, AsmToks, AsmString,
+                              Clobbers, EndLoc);
     return Owned(NS);
   }
 
@@ -2930,7 +2929,7 @@
 
   MSAsmStmt *NS =
     new (Context) MSAsmStmt(Context, AsmLoc, IsSimple, /* IsVolatile */ true,
-                            AsmToks, LineEnds, AsmString, Clobbers, EndLoc);
+                            AsmToks, AsmString, Clobbers, EndLoc);
 
   return Owned(NS);
 }
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 73f42d9..0516768 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -1186,9 +1186,8 @@
   /// Subclasses may override this routine to provide different behavior.
   StmtResult RebuildMSAsmStmt(SourceLocation AsmLoc,
                               ArrayRef<Token> AsmToks,
-                              ArrayRef<unsigned> LineEnds,
                               SourceLocation EndLoc) {
-    return getSema().ActOnMSAsmStmt(AsmLoc, AsmToks, LineEnds, EndLoc);
+    return getSema().ActOnMSAsmStmt(AsmLoc, AsmToks, EndLoc);
   }
 
   /// \brief Build a new Objective-C \@try statement.
@@ -5610,12 +5609,8 @@
 TreeTransform<Derived>::TransformMSAsmStmt(MSAsmStmt *S) {
   ArrayRef<Token> AsmToks =
     llvm::makeArrayRef(S->getAsmToks(), S->getNumAsmToks());
-  ArrayRef<unsigned> LineEnds =
-    llvm::makeArrayRef(S->getLineEnds(), S->getNumLineEnds());
 
-  // No need to transform the asm string literal.
-  return getDerived().RebuildMSAsmStmt(S->getAsmLoc(), AsmToks, LineEnds,
-                                       S->getEndLoc());
+  return getDerived().RebuildMSAsmStmt(S->getAsmLoc(), AsmToks, S->getEndLoc());
 }
 
 template<typename Derived>