[ms-inline asm] Make the AsmStmt class non-virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162768 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 455a24f..2303cb9 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -1393,8 +1393,6 @@
   explicit AsmStmt(StmtClass SC, EmptyShell Empty) :
     Stmt(SC, Empty), Names(0), Exprs(0) { }
 
-  virtual ~AsmStmt() { }
-
   SourceLocation getAsmLoc() const { return AsmLoc; }
   void setAsmLoc(SourceLocation L) { AsmLoc = L; }
 
@@ -1409,7 +1407,7 @@
   //===--- Asm String Analysis ---===//
 
   /// Assemble final IR asm string.
-  virtual std::string generateAsmString(ASTContext &C) const = 0;
+  std::string generateAsmString(ASTContext &C) const;
 
   //===--- Output operands ---===//
 
@@ -1429,7 +1427,7 @@
   /// getOutputConstraint - Return the constraint string for the specified
   /// output operand.  All output constraints are known to be non-empty (either
   /// '=' or '+').
-  virtual StringRef getOutputConstraint(unsigned i) const = 0;
+  StringRef getOutputConstraint(unsigned i) const;
 
   /// isOutputPlusConstraint - Return true if the specified output constraint
   /// is a "+" constraint (which is both an input and an output) or false if it
@@ -1438,7 +1436,7 @@
     return getOutputConstraint(i)[0] == '+';
   }
 
-  virtual const Expr *getOutputExpr(unsigned i) const = 0;
+  const Expr *getOutputExpr(unsigned i) const;
 
   /// getNumPlusOperands - Return the number of output operands that have a "+"
   /// constraint.
@@ -1461,14 +1459,14 @@
 
   /// getInputConstraint - Return the specified input constraint.  Unlike output
   /// constraints, these can be empty.
-  virtual StringRef getInputConstraint(unsigned i) const = 0;
-
-  virtual const Expr *getInputExpr(unsigned i) const = 0;
+  StringRef getInputConstraint(unsigned i) const;
+  
+  const Expr *getInputExpr(unsigned i) const;
 
   //===--- Other ---===//
 
   unsigned getNumClobbers() const { return NumClobbers; }
-  virtual StringRef getClobber(unsigned i) const = 0;
+  StringRef getClobber(unsigned i) const;
 
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == GCCAsmStmtClass ||
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index b7c2b39..e486d05 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -321,6 +321,60 @@
   }
 }
 
+std::string AsmStmt::generateAsmString(ASTContext &C) const {
+  StmtClass stmtClass = getStmtClass();
+  if (stmtClass == Stmt::GCCAsmStmtClass)
+    return static_cast<const GCCAsmStmt*>(this)->generateAsmString(C);
+  if (stmtClass == Stmt::MSAsmStmtClass)
+    return static_cast<const MSAsmStmt*>(this)->generateAsmString(C);
+  llvm_unreachable("unknown asm statement kind!");
+}
+
+StringRef AsmStmt::getOutputConstraint(unsigned i) const {
+  StmtClass stmtClass = getStmtClass();
+  if (stmtClass == Stmt::GCCAsmStmtClass)
+    return static_cast<const GCCAsmStmt*>(this)->getOutputConstraint(i);
+  if (stmtClass == Stmt::MSAsmStmtClass)
+    return static_cast<const MSAsmStmt*>(this)->getOutputConstraint(i);
+  llvm_unreachable("unknown asm statement kind!");
+}
+
+const Expr *AsmStmt::getOutputExpr(unsigned i) const {
+  StmtClass stmtClass = getStmtClass();
+  if (stmtClass == Stmt::GCCAsmStmtClass)
+    return static_cast<const GCCAsmStmt*>(this)->getOutputExpr(i);
+  if (stmtClass == Stmt::MSAsmStmtClass)
+    return static_cast<const MSAsmStmt*>(this)->getOutputExpr(i);
+  llvm_unreachable("unknown asm statement kind!");
+}
+
+StringRef AsmStmt::getInputConstraint(unsigned i) const {
+  StmtClass stmtClass = getStmtClass();
+  if (stmtClass == Stmt::GCCAsmStmtClass)
+    return static_cast<const GCCAsmStmt*>(this)->getInputConstraint(i);
+  if (stmtClass == Stmt::MSAsmStmtClass)
+    return static_cast<const MSAsmStmt*>(this)->getInputConstraint(i);
+  llvm_unreachable("unknown asm statement kind!");
+}
+
+const Expr *AsmStmt::getInputExpr(unsigned i) const {
+  StmtClass stmtClass = getStmtClass();
+  if (stmtClass == Stmt::GCCAsmStmtClass)
+    return static_cast<const GCCAsmStmt*>(this)->getInputExpr(i);
+  if (stmtClass == Stmt::MSAsmStmtClass)
+    return static_cast<const MSAsmStmt*>(this)->getInputExpr(i);
+  llvm_unreachable("unknown asm statement kind!");
+}
+
+StringRef AsmStmt::getClobber(unsigned i) const {
+  StmtClass stmtClass = getStmtClass();
+  if (stmtClass == Stmt::GCCAsmStmtClass)
+    return static_cast<const GCCAsmStmt*>(this)->getClobber(i);
+  if (stmtClass == Stmt::MSAsmStmtClass)
+    return static_cast<const MSAsmStmt*>(this)->getClobber(i);
+  llvm_unreachable("unknown asm statement kind!");
+}
+
 /// getNumPlusOperands - Return the number of output operands that have a "+"
 /// constraint.
 unsigned AsmStmt::getNumPlusOperands() const {