From df4ee102aa909e2f40c294701bfeffac63e8d29b Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Mon, 20 Aug 2012 17:11:53 +0000 Subject: [PATCH] [ms-inline asm] Remove old cruft now that MS-style asms their own code path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162210 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Stmt.h | 10 ++++------ include/clang/Sema/Sema.h | 3 +-- lib/AST/Stmt.cpp | 7 +++---- lib/Sema/AnalysisBasedWarnings.cpp | 7 ------- lib/Sema/SemaStmtAsm.cpp | 8 ++++---- lib/Sema/TreeTransform.h | 8 +++----- lib/Serialization/ASTReaderStmt.cpp | 1 - lib/Serialization/ASTWriterStmt.cpp | 1 - 8 files changed, 15 insertions(+), 30 deletions(-) diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 35fb69312b..19da420272 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -1385,10 +1385,10 @@ class AsmStmt : public Stmt { public: AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, bool isvolatile, - bool msasm, unsigned numoutputs, unsigned numinputs, - IdentifierInfo **names, StringLiteral **constraints, - Expr **exprs, StringLiteral *asmstr, unsigned numclobbers, - StringLiteral **clobbers, SourceLocation rparenloc); + unsigned numoutputs, unsigned numinputs, IdentifierInfo **names, + StringLiteral **constraints, Expr **exprs, StringLiteral *asmstr, + unsigned numclobbers, StringLiteral **clobbers, + SourceLocation rparenloc); /// \brief Build an empty inline-assembly statement. explicit AsmStmt(EmptyShell Empty) : Stmt(AsmStmtClass, Empty), @@ -1403,8 +1403,6 @@ public: void setVolatile(bool V) { IsVolatile = V; } bool isSimple() const { return IsSimple; } void setSimple(bool V) { IsSimple = V; } - bool isMSAsm() const { return MSAsm; } - void setMSAsm(bool V) { MSAsm = V; } //===--- Asm String Analysis ---===// diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 4f1b2f6aa9..4be532c56f 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -2544,8 +2544,7 @@ public: MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, - SourceLocation RParenLoc, - bool MSAsm = false); + SourceLocation RParenLoc); StmtResult ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 77452c9d9d..963a20c338 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -559,14 +559,13 @@ QualType CXXCatchStmt::getCaughtType() const { //===----------------------------------------------------------------------===// AsmStmt::AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, - bool isvolatile, bool msasm, - unsigned numoutputs, unsigned numinputs, + bool isvolatile, unsigned numoutputs, unsigned numinputs, IdentifierInfo **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), MSAsm(msasm) - , NumOutputs(numoutputs), NumInputs(numinputs), NumClobbers(numclobbers) { + , IsSimple(issimple), IsVolatile(isvolatile), NumOutputs(numoutputs) + , NumInputs(numinputs), NumClobbers(numclobbers) { unsigned NumExprs = NumOutputs + NumInputs; diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 19a7d6f35c..93be773f2d 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -182,13 +182,6 @@ static ControlFlowKind CheckFallThrough(AnalysisDeclContext &AC) { HasFakeEdge = true; continue; } - if (const AsmStmt *AS = dyn_cast(S)) { - if (AS->isMSAsm()) { - HasFakeEdge = true; - HasLiveReturn = true; - continue; - } - } if (isa(S)) { // TODO: Verify this is correct. HasFakeEdge = true; diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp index 0a7d980a9f..591a91c7e5 100644 --- a/lib/Sema/SemaStmtAsm.cpp +++ b/lib/Sema/SemaStmtAsm.cpp @@ -94,7 +94,7 @@ StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, bool IsSimple, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg constraints, MultiExprArg exprs, Expr *asmString, MultiExprArg clobbers, - SourceLocation RParenLoc, bool MSAsm) { + SourceLocation RParenLoc) { unsigned NumClobbers = clobbers.size(); StringLiteral **Constraints = reinterpret_cast(constraints.get()); @@ -199,9 +199,9 @@ StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, bool IsSimple, } AsmStmt *NS = - new (Context) AsmStmt(Context, AsmLoc, IsSimple, IsVolatile, MSAsm, - NumOutputs, NumInputs, Names, Constraints, Exprs, - AsmString, NumClobbers, Clobbers, RParenLoc); + new (Context) AsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs, + NumInputs, Names, Constraints, Exprs, AsmString, + NumClobbers, Clobbers, RParenLoc); // Validate the asm string, ensuring it makes sense given the operands we // have. SmallVector Pieces; diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 619ad330b9..05a3c611e9 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -1172,12 +1172,11 @@ public: MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, - SourceLocation RParenLoc, - bool MSAsm) { + SourceLocation RParenLoc) { return getSema().ActOnAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs, NumInputs, Names, move(Constraints), Exprs, AsmString, Clobbers, - RParenLoc, MSAsm); + RParenLoc); } /// \brief Build a new MS style inline asm statement. @@ -5600,8 +5599,7 @@ TreeTransform::TransformAsmStmt(AsmStmt *S) { move_arg(Exprs), AsmString.get(), move_arg(Clobbers), - S->getRParenLoc(), - S->isMSAsm()); + S->getRParenLoc()); } template diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index c5325b5f78..e6f62f8d9d 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/lib/Serialization/ASTReaderStmt.cpp @@ -297,7 +297,6 @@ void ASTStmtReader::VisitAsmStmt(AsmStmt *S) { S->setRParenLoc(ReadSourceLocation(Record, Idx)); S->setVolatile(Record[Idx++]); S->setSimple(Record[Idx++]); - S->setMSAsm(Record[Idx++]); S->setAsmString(cast_or_null(Reader.ReadSubStmt())); diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp index f63388fa2f..9f12b8a48e 100644 --- a/lib/Serialization/ASTWriterStmt.cpp +++ b/lib/Serialization/ASTWriterStmt.cpp @@ -227,7 +227,6 @@ void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) { Writer.AddSourceLocation(S->getRParenLoc(), Record); Record.push_back(S->isVolatile()); Record.push_back(S->isSimple()); - Record.push_back(S->isMSAsm()); Writer.AddStmt(S->getAsmString()); // Outputs -- 2.40.0