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; }
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; }
StmtResult ActOnMSAsmStmt(SourceLocation AsmLoc,
ArrayRef<Token> AsmToks,
- ArrayRef<unsigned> LineEnds,
SourceLocation EndLoc);
VarDecl *BuildObjCExceptionDecl(TypeSourceInfo *TInfo, QualType ExceptionType,
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.
SourceManager &SrcMgr = PP.getSourceManager();
SourceLocation EndLoc = AsmLoc;
SmallVector<Token, 4> AsmToks;
- SmallVector<unsigned, 4> LineEnds;
bool InBraces = false;
unsigned short savedBraceCount = 0;
++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);
}
// 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.
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);
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);
}
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);
}
MSAsmStmt *NS =
new (Context) MSAsmStmt(Context, AsmLoc, IsSimple, /* IsVolatile */ true,
- AsmToks, LineEnds, AsmString, Clobbers, EndLoc);
+ AsmToks, AsmString, Clobbers, EndLoc);
return Owned(NS);
}
/// 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.
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>