summaryrefslogtreecommitdiffstats
path: root/clang/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
commit65e6bd6246c53fb2a40f8f81d6535a5013cdb1fe (patch)
treee0e936c02f383abec6e7a6162266dfc455b19f41 /clang/lib/Frontend/RewriteObjC.cpp
parentcf1884c2465e52ddd08acc01978a63ffc7b3572a (diff)
downloadbcm5719-llvm-65e6bd6246c53fb2a40f8f81d6535a5013cdb1fe.tar.gz
bcm5719-llvm-65e6bd6246c53fb2a40f8f81d6535a5013cdb1fe.zip
More cleanup/refactoring of the rewrite.
llvm-svn: 92062
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r--clang/lib/Frontend/RewriteObjC.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index 4e8679c5885..3ef3a061193 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud