diff options
author | Steve Naroff <snaroff@apple.com> | 2008-01-19 00:42:38 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-01-19 00:42:38 +0000 |
commit | c7d2df23f8f19c3b72f0a8c4e9b893642d0eb78b (patch) | |
tree | 22f12527a726310869ce5b036a230fc03941e166 /clang/Driver/RewriteTest.cpp | |
parent | 802583656e60afbe7ae95383dc6965ddcd8045c3 (diff) | |
download | bcm5719-llvm-c7d2df23f8f19c3b72f0a8c4e9b893642d0eb78b.tar.gz bcm5719-llvm-c7d2df23f8f19c3b72f0a8c4e9b893642d0eb78b.zip |
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.
llvm-svn: 46184
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r-- | clang/Driver/RewriteTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index d9af1f97438..20c684c0d0e 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/Driver/RewriteTest.cpp @@ -1207,7 +1207,10 @@ Stmt *RewriteTest::RewriteObjCThrowStmt(ObjCAtThrowStmt *S) { 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 ';'"); |