/// BlockLiteralTy - The type of the block literal.
const llvm::Type *BlockLiteralTy;
- /// Name - the name of the function this block was created for, if any
+ /// Name - the name of the function this block was created for, if any.
const char *Name;
/// ByCopyDeclRefs - Variables from parent scopes that have been imported
llvm::SmallVector<const BlockDeclRefExpr *, 8> ByRefDeclRefs;
BlockInfo(const llvm::Type *blt, const char *n)
- : BlockLiteralTy(blt), Name(n) {}
+ : BlockLiteralTy(blt), Name(n) {
+ // Skip asm prefix, if any.
+ if (Name && Name[0] == '\01')
+ ++Name;
+ }
};
CGBuilderTy &Builder;
-// RUN: clang-cc -emit-llvm -fblocks -S -o - %s
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s &&
// rdar://6676764
struct S {
-(void) im0;
@end
+// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t &&
+@implementation A
+-(void) im0 {
+ (void) ^{ return 1; }();
+}
+@end
+
@interface B : A @end
@implementation B
-(void) im1 {
^(void) { [super im0]; }();
}
@end
+
+// RUN: true