Convert more statments over to SourceRanges...
llvm-svn: 41666
diff --git a/clang/AST/Stmt.cpp b/clang/AST/Stmt.cpp
index 17f59a4..9b405f1e 100644
--- a/clang/AST/Stmt.cpp
+++ b/clang/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
//===----------------------------------------------------------------------===//