[cfe-commits] r92526 - in /cfe/trunk: include/clang/AST/Stmt.h include/clang/Parse/Action.h lib/AST/Stmt.cpp lib/Frontend/PCHReaderStmt.cpp lib/Frontend/PCHWriterStmt.cpp lib/Parse/ParseStmt.cpp lib/Sema/Sema.h lib/Sema/SemaStmt.cpp

Mike Stump mrs at apple.com
Mon Jan 4 14:37:17 PST 2010


Author: mrs
Date: Mon Jan  4 16:37:17 2010
New Revision: 92526

URL: http://llvm.org/viewvc/llvm-project?rev=92526&view=rev
Log:
Remember if the AsmStmt came from Microsoft-style inline assembly code.

Modified:
    cfe/trunk/include/clang/AST/Stmt.h
    cfe/trunk/include/clang/Parse/Action.h
    cfe/trunk/lib/AST/Stmt.cpp
    cfe/trunk/lib/Frontend/PCHReaderStmt.cpp
    cfe/trunk/lib/Frontend/PCHWriterStmt.cpp
    cfe/trunk/lib/Parse/ParseStmt.cpp
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Mon Jan  4 16:37:17 2010
@@ -1116,6 +1116,7 @@
 
   bool IsSimple;
   bool IsVolatile;
+  bool MSAsm;
 
   unsigned NumOutputs;
   unsigned NumInputs;
@@ -1126,7 +1127,7 @@
 
   llvm::SmallVector<StringLiteral*, 4> Clobbers;
 public:
-  AsmStmt(SourceLocation asmloc, bool issimple, bool isvolatile,
+  AsmStmt(SourceLocation asmloc, bool issimple, bool isvolatile, bool msasm,
           unsigned numoutputs, unsigned numinputs,
           std::string *names, StringLiteral **constraints,
           Expr **exprs, StringLiteral *asmstr, unsigned numclobbers,
@@ -1144,6 +1145,8 @@
   void setVolatile(bool V) { IsVolatile = V; }
   bool isSimple() const { return IsSimple; }
   void setSimple(bool V) { IsSimple = false; }
+  bool isMSAsm() const { return MSAsm; }
+  void setMSAsm(bool V) { MSAsm = V; }
 
   //===--- Asm String Analysis ---===//
 

Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Mon Jan  4 16:37:17 2010
@@ -866,7 +866,8 @@
                                         MultiExprArg Exprs,
                                         ExprArg AsmString,
                                         MultiExprArg Clobbers,
-                                        SourceLocation RParenLoc) {
+                                        SourceLocation RParenLoc,
+                                        bool MSAsm = false) {
     return StmtEmpty();
   }
 

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Mon Jan  4 16:37:17 2010
@@ -337,12 +337,12 @@
 //===----------------------------------------------------------------------===//
 
 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]);

Modified: cfe/trunk/lib/Frontend/PCHReaderStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderStmt.cpp?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderStmt.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderStmt.cpp Mon Jan  4 16:37:17 2010
@@ -304,6 +304,7 @@
   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);

Modified: cfe/trunk/lib/Frontend/PCHWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriterStmt.cpp?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriterStmt.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriterStmt.cpp Mon Jan  4 16:37:17 2010
@@ -277,6 +277,7 @@
   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

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Mon Jan  4 16:37:17 2010
@@ -1182,7 +1182,7 @@
   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.

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Mon Jan  4 16:37:17 2010
@@ -1383,7 +1383,8 @@
                                         MultiExprArg Exprs,
                                         ExprArg AsmString,
                                         MultiExprArg Clobbers,
-                                        SourceLocation RParenLoc);
+                                        SourceLocation RParenLoc,
+                                        bool MSAsm = false);
 
   virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
                                                 SourceLocation RParen,

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=92526&r1=92525&r2=92526&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Mon Jan  4 16:37:17 2010
@@ -1157,7 +1157,8 @@
                                           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 @@
   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;





More information about the cfe-commits mailing list