[cfe-commits] r92062 - /cfe/trunk/lib/Frontend/RewriteObjC.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Dec 23 13:52:33 PST 2009


Author: fjahanian
Date: Wed Dec 23 15:52:32 2009
New Revision: 92062

URL: http://llvm.org/viewvc/llvm-project?rev=92062&view=rev
Log:
More cleanup/refactoring of the rewrite.


Modified:
    cfe/trunk/lib/Frontend/RewriteObjC.cpp

Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=92062&r1=92061&r2=92062&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Wed Dec 23 15:52:32 2009
@@ -4581,16 +4581,14 @@
       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());





More information about the cfe-commits mailing list