Convert more statments over to SourceRanges...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41666 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Stmt.cpp b/AST/Stmt.cpp
index 17f59a4..9b405f1 100644
--- a/AST/Stmt.cpp
+++ b/AST/Stmt.cpp
@@ -81,6 +81,14 @@
   return getID()->getName();
 }
 
+// This is defined here to avoid polluting Stmt.h with importing Expr.h
+SourceRange ReturnStmt::getSourceRange() const { 
+  if (RetExpr)
+    return SourceRange(RetLoc, RetExpr->getLocEnd());
+  else
+    return SourceRange(RetLoc);
+}
+
 //===----------------------------------------------------------------------===//
 //  Child Iterators for iterating over subexpressions/substatements
 //===----------------------------------------------------------------------===//