diff options
author | Mike Stump <mrs@apple.com> | 2010-01-04 22:37:17 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2010-01-04 22:37:17 +0000 |
commit | 90be58afce42b766dcb0a5bcaa54d136ffb63b58 (patch) | |
tree | 0a38051f4638eeeb9aeaac712e51e0851a8f87e2 /clang/lib | |
parent | b8e66c3b143b2057bde555468b4f7116f4e6eb55 (diff) | |
download | bcm5719-llvm-90be58afce42b766dcb0a5bcaa54d136ffb63b58.tar.gz bcm5719-llvm-90be58afce42b766dcb0a5bcaa54d136ffb63b58.zip |
Remember if the AsmStmt came from Microsoft-style inline assembly code.
llvm-svn: 92526
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Frontend/PCHReaderStmt.cpp | 1 | ||||
-rw-r--r-- | clang/lib/Frontend/PCHWriterStmt.cpp | 1 | ||||
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/Sema.h | 3 | ||||
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 9 |
6 files changed, 12 insertions, 8 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 7c7aeb8d3e1..104e3361892 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -337,12 +337,12 @@ unsigned AsmStmt::AnalyzeAsmString(llvm::SmallVectorImpl<AsmStringPiece>&Pieces, //===----------------------------------------------------------------------===// AsmStmt::AsmStmt(SourceLocation asmloc, bool issimple, bool isvolatile, - unsigned numoutputs, unsigned numinputs, + bool msasm, unsigned numoutputs, unsigned numinputs, std::string *names, StringLiteral **constraints, Expr **exprs, StringLiteral *asmstr, unsigned numclobbers, StringLiteral **clobbers, SourceLocation rparenloc) : Stmt(AsmStmtClass), AsmLoc(asmloc), RParenLoc(rparenloc), AsmStr(asmstr) - , IsSimple(issimple), IsVolatile(isvolatile) + , IsSimple(issimple), IsVolatile(isvolatile), MSAsm(msasm) , NumOutputs(numoutputs), NumInputs(numinputs) { for (unsigned i = 0, e = numinputs + numoutputs; i != e; i++) { Names.push_back(names[i]); diff --git a/clang/lib/Frontend/PCHReaderStmt.cpp b/clang/lib/Frontend/PCHReaderStmt.cpp index ba82d260102..c108f549ab2 100644 --- a/clang/lib/Frontend/PCHReaderStmt.cpp +++ b/clang/lib/Frontend/PCHReaderStmt.cpp @@ -304,6 +304,7 @@ unsigned PCHStmtReader::VisitAsmStmt(AsmStmt *S) { S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); S->setVolatile(Record[Idx++]); S->setSimple(Record[Idx++]); + S->setMSAsm(Record[Idx++]); unsigned StackIdx = StmtStack.size() - (NumOutputs*2 + NumInputs*2 + NumClobbers + 1); diff --git a/clang/lib/Frontend/PCHWriterStmt.cpp b/clang/lib/Frontend/PCHWriterStmt.cpp index abf4eaa0f8a..4be9b817ed8 100644 --- a/clang/lib/Frontend/PCHWriterStmt.cpp +++ b/clang/lib/Frontend/PCHWriterStmt.cpp @@ -277,6 +277,7 @@ void PCHStmtWriter::VisitAsmStmt(AsmStmt *S) { Writer.AddSourceLocation(S->getRParenLoc(), Record); Record.push_back(S->isVolatile()); Record.push_back(S->isSimple()); + Record.push_back(S->isMSAsm()); Writer.WriteSubStmt(S->getAsmString()); // Outputs diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index 9085b8713df..277cc91d37c 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1182,7 +1182,7 @@ Parser::OwningStmtResult Parser::FuzzyParseMicrosoftAsmStatement() { return Actions.ActOnAsmStmt(Tok.getLocation(), true, true, 0, 0, Names.data(), move_arg(Constraints), move_arg(Exprs), move(AsmString), move_arg(Clobbers), - Tok.getLocation()); + Tok.getLocation(), true); } /// ParseAsmStatement - Parse a GNU extended asm statement. diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 110a6268355..df25025d773 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1383,7 +1383,8 @@ public: MultiExprArg Exprs, ExprArg AsmString, MultiExprArg Clobbers, - SourceLocation RParenLoc); + SourceLocation RParenLoc, + bool MSAsm = false); virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, SourceLocation RParen, diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index b8928c36e7b..7855a7f6093 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -1157,7 +1157,8 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, MultiExprArg exprs, ExprArg asmString, MultiExprArg clobbers, - SourceLocation RParenLoc) { + SourceLocation RParenLoc, + bool MSAsm) { unsigned NumClobbers = clobbers.size(); StringLiteral **Constraints = reinterpret_cast<StringLiteral**>(constraints.get()); @@ -1261,9 +1262,9 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, asmString.release(); clobbers.release(); AsmStmt *NS = - new (Context) AsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs, NumInputs, - Names, Constraints, Exprs, AsmString, NumClobbers, - Clobbers, RParenLoc); + new (Context) AsmStmt(AsmLoc, IsSimple, IsVolatile, MSAsm, NumOutputs, + NumInputs, Names, Constraints, Exprs, AsmString, + NumClobbers, Clobbers, RParenLoc); // Validate the asm string, ensuring it makes sense given the operands we // have. llvm::SmallVector<AsmStmt::AsmStringPiece, 8> Pieces; |