- Move ExprIterator to Stmt.h so that it can be used by classes defined in Stmt.h
- Implement child_begin() and child_end() for AsmStmt.  Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement.
- Use ExprIterator for performing iteration over input/output operands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58261 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index f30e105..9c06807 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -128,6 +128,19 @@
   }
 }
 
+const Expr* AsmStmt::getOutputExpr(unsigned i) const {
+  return cast<Expr>(Exprs[i]);
+}
+Expr* AsmStmt::getOutputExpr(unsigned i) {
+  return cast<Expr>(Exprs[i]);
+}
+Expr* AsmStmt::getInputExpr(unsigned i) {
+  return cast<Expr>(Exprs[i + NumOutputs]);
+}
+const Expr* AsmStmt::getInputExpr(unsigned i) const {
+  return cast<Expr>(Exprs[i + NumOutputs]);
+}
+
 //===----------------------------------------------------------------------===//
 // Constructors
 //===----------------------------------------------------------------------===//
@@ -279,8 +292,12 @@
 }
 
 // AsmStmt
-Stmt::child_iterator AsmStmt::child_begin() { return child_iterator(); }
-Stmt::child_iterator AsmStmt::child_end() { return child_iterator(); }
+Stmt::child_iterator AsmStmt::child_begin() { 
+  return Exprs.empty() ? 0 : &Exprs[0];
+}
+Stmt::child_iterator AsmStmt::child_end() {
+  return Exprs.empty() ? 0 : &Exprs[0] + Exprs.size();
+}
 
 // ObjCAtCatchStmt
 Stmt::child_iterator ObjCAtCatchStmt::child_begin() { return &SubExprs[0]; }