Fix two bugs with an @throw that doesn't have a statement.
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46184 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index d9af1f9..20c684c 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -1207,7 +1207,10 @@
 
   std::string buf;
   /* void objc_exception_throw(id) __attribute__((noreturn)); */
-  buf = "objc_exception_throw(";
+  if (S->getThrowExpr())
+    buf = "objc_exception_throw(";
+  else // add an implicit argument
+    buf = "objc_exception_throw(_caught";
   Rewrite.ReplaceText(startLoc, 6, buf.c_str(), buf.size());
   const char *semiBuf = strchr(startBuf, ';');
   assert((*semiBuf == ';') && "@throw: can't find ';'");