aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteBlocks.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-06-08 04:24:21 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-06-08 04:24:21 +0000
commit687abffee40d0459fe5eecf3e5ee6e60be69d93c (patch)
tree84700b898af8fe2c81d9ae12ab7f1c96d5d1a69a /lib/Frontend/RewriteBlocks.cpp
parent02d95baf23cbb29ea4ca58b3e8f54f92f845b900 (diff)
Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility for block pointers. Note that unlike an earlier revision proposed on cfe-commits, this patch still allows declaring block pointers without a prototype. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteBlocks.cpp')
-rw-r--r--lib/Frontend/RewriteBlocks.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Frontend/RewriteBlocks.cpp b/lib/Frontend/RewriteBlocks.cpp
index 9d73d90554..8393574d1e 100644
--- a/lib/Frontend/RewriteBlocks.cpp
+++ b/lib/Frontend/RewriteBlocks.cpp
@@ -1011,9 +1011,7 @@ Stmt *RewriteBlocks::RewriteFunctionBody(Stmt *S) {
CI != E; ++CI)
if (*CI) {
if (BlockExpr *CBE = dyn_cast<BlockExpr>(*CI)) {
- Stmt *newStmt = RewriteFunctionBody(CBE->getBody());
- if (newStmt)
- *CI = newStmt;
+ RewriteFunctionBody(CBE->getBody());
// We've just rewritten the block body in place.
// Now we snarf the rewritten text and stash it away for later use.
@@ -1023,9 +1021,7 @@ Stmt *RewriteBlocks::RewriteFunctionBody(Stmt *S) {
// Do the rewrite, using S.size() which contains the rewritten size.
ReplaceText(CBE->getLocStart(), S.size(), Init.c_str(), Init.size());
} else {
- Stmt *newStmt = RewriteFunctionBody(*CI);
- if (newStmt)
- *CI = newStmt;
+ RewriteFunctionBody(*CI);
}
}
// Handle specific things.