[cfe-commits] r113749 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/block-var-layout.m
Fariborz Jahanian
fjahanian at apple.com
Mon Sep 13 09:09:44 PDT 2010
Author: fjahanian
Date: Mon Sep 13 11:09:44 2010
New Revision: 113749
URL: http://llvm.org/viewvc/llvm-project?rev=113749&view=rev
Log:
Block description for trivial block literals have
their 'isa' field scanned regardless.
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/test/CodeGenObjC/block-var-layout.m
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=113749&r1=113748&r2=113749&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Sep 13 11:09:44 2010
@@ -1666,8 +1666,7 @@
const llvm::SmallVectorImpl<const Expr *> &BlockLayout) {
llvm::Constant *NullPtr =
llvm::Constant::getNullValue(llvm::Type::getInt8PtrTy(VMContext));
- if ((CGM.getLangOptions().getGCMode() == LangOptions::NonGC) ||
- BlockLayout.empty())
+ if (CGM.getLangOptions().getGCMode() == LangOptions::NonGC)
return NullPtr;
bool hasUnion = false;
SkipIvars.clear();
Modified: cfe/trunk/test/CodeGenObjC/block-var-layout.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/block-var-layout.m?rev=113749&r1=113748&r2=113749&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/block-var-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/block-var-layout.m Mon Sep 13 11:09:44 2010
@@ -123,6 +123,11 @@
wrapperBlock();
}
+void test_empty_block() {
+ void (^wrapperBlock)() = ^() {
+ };
+ wrapperBlock();
+}
// CHECK-LP64: L_OBJC_CLASS_NAME_:
// CHECK-LP64-NEXT: .asciz "\0011\024"
@@ -141,3 +146,6 @@
// CHECK-LP64: L_OBJC_CLASS_NAME_16:
// CHECK-LP64-NEXT: .asciz "\0013"
+
+// CHECK-LP64: L_OBJC_CLASS_NAME_20:
+// CHECK-LP64-NEXT: .asciz "\001"
More information about the cfe-commits
mailing list