[cfe-commits] r161904 - in /cfe/trunk: include/clang/AST/Stmt.h include/clang/Sema/Sema.h lib/AST/Stmt.cpp lib/Parse/ParseStmt.cpp lib/Sema/SemaStmt.cpp lib/Sema/TreeTransform.h
Chad Rosier
mcrosier at apple.com
Tue Aug 14 16:14:45 PDT 2012
Author: mcrosier
Date: Tue Aug 14 18:14:45 2012
New Revision: 161904
URL: http://llvm.org/viewvc/llvm-project?rev=161904&view=rev
Log:
[ms-inline asm] Remove the last bits of LineEnds.
Modified:
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=161904&r1=161903&r2=161904&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Tue Aug 14 18:14:45 2012
@@ -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; }
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=161904&r1=161903&r2=161904&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Aug 14 18:14:45 2012
@@ -2543,7 +2543,6 @@
StmtResult ActOnMSAsmStmt(SourceLocation AsmLoc,
ArrayRef<Token> AsmToks,
- ArrayRef<unsigned> LineEnds,
SourceLocation EndLoc);
VarDecl *BuildObjCExceptionDecl(TypeSourceInfo *TInfo, QualType ExceptionType,
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=161904&r1=161903&r2=161904&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Tue Aug 14 18:14:45 2012
@@ -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.
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=161904&r1=161903&r2=161904&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Aug 14 18:14:45 2012
@@ -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.
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=161904&r1=161903&r2=161904&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Tue Aug 14 18:14:45 2012
@@ -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);
}
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=161904&r1=161903&r2=161904&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue Aug 14 18:14:45 2012
@@ -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>
More information about the cfe-commits
mailing list