aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-12-23 21:52:32 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-12-23 21:52:32 +0000
commitff1278809e62d1da22da171752cc5f07734bcf0c (patch)
tree95094122fb84a1191917b39293c0d5491e6764b4 /lib/Frontend/RewriteObjC.cpp
parent0ad57fb93ae53ac94ebcd247201f60d87600188f (diff)
More cleanup/refactoring of the rewrite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r--lib/Frontend/RewriteObjC.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 4e8679c588..3ef3a06119 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -4581,16 +4581,14 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp) {
InitExprs.push_back(Exp);
}
}
- if (ImportedBlockDecls.size()) { // generate "1<<25" to indicate we have helper functions.
+ if (ImportedBlockDecls.size()) {
+ // generate BLOCK_HAS_COPY_DISPOSE(have helper funcs) | BLOCK_HAS_DESCRIPTOR
+ int flag = (BLOCK_HAS_COPY_DISPOSE | BLOCK_HAS_DESCRIPTOR);
unsigned IntSize =
static_cast<unsigned>(Context->getTypeSize(Context->IntTy));
- BinaryOperator *Exp = new (Context) BinaryOperator(
- new (Context) IntegerLiteral(llvm::APInt(IntSize, 1),
- Context->IntTy,SourceLocation()),
- new (Context) IntegerLiteral(llvm::APInt(IntSize, 25),
- Context->IntTy, SourceLocation()),
- BinaryOperator::Shl, Context->IntTy, SourceLocation());
- InitExprs.push_back(Exp);
+ Expr *FlagExp = new (Context) IntegerLiteral(llvm::APInt(IntSize, flag),
+ Context->IntTy, SourceLocation());
+ InitExprs.push_back(FlagExp);
}
NewRep = new (Context) CallExpr(*Context, DRE, &InitExprs[0], InitExprs.size(),
FType, SourceLocation());