/// -fobjc-nonfragile-abi by default.
virtual bool IsObjCNonFragileABIDefault() const { return false; }
+ /// IsObjCLegacyDispatchDefault - Does this tool chain set
+ /// -fobjc-legacy-dispatch by default (this is only used with the non-fragile
+ /// ABI).
+ virtual bool IsObjCLegacyDispatchDefault() const { return false; }
+
/// GetDefaultStackProtectorLevel - Get the default stack protector level for
/// this tool chain (0=off, 1=on, 2=all).
virtual unsigned GetDefaultStackProtectorLevel() const { return 0; }
// Non-fragile ABI default to on for iPhoneOS and x86-64.
return isTargetIPhoneOS() || getTriple().getArch() == llvm::Triple::x86_64;
}
+ virtual bool IsObjCLegacyDispatchDefault() const {
+ // This is only used with the non-fragile ABI.
+ return (getTriple().getArch() == llvm::Triple::arm ||
+ getTriple().getArch() == llvm::Triple::thumb);
+ }
virtual bool IsUnwindTablesDefault() const;
virtual unsigned GetDefaultStackProtectorLevel() const {
// Stack protectors default to on for 10.6 and beyond.
// defaults to off.
if (Args.hasFlag(options::OPT_fobjc_legacy_dispatch,
options::OPT_fno_objc_legacy_dispatch,
- false))
+ getToolChain().IsObjCLegacyDispatchDefault()))
CmdArgs.push_back("-fobjc-legacy-dispatch");
}
}
// CHECK-NOT: ssp
// CHECK: ) {
// CHECK: @__f0_block_invoke
+// CHECK: void @f1
+// CHECK-NOT: msgSend_fixup_alloc
+// CHECK: OBJC_SELECTOR_REFERENCES
int f0() {
return ^(){ return 0; }();
@implementation I0
@synthesize p0 = __sythesized_p0;
@end
+
+@interface I1
++(id) alloc;
+@end
+
+void f1() {
+ [I1 alloc];
+}
+