mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-28 07:49:01 -04:00

CodeGen-level implementation. Instead of adding an attribute to clang's FunctionDecl, add the IR attribute directly. This means a module built with this flag is now compatible with code built without it and vice versa. This change also results in the 'noalias' attribute no longer being added to calls to operator new in the IR; it's now only added to the declaration. It also fixes a bug where we failed to add the attribute to the 'nothrow' versions (because we didn't implicitly declare them, there was no good time to inject a fake attribute). llvm-svn: 265728
40 lines
782 B
Plaintext
40 lines
782 B
Plaintext
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// rdar://problem/9158302
|
|
// This should not use a memmove_collectable in non-GC mode.
|
|
namespace test0 {
|
|
struct A {
|
|
id x;
|
|
};
|
|
|
|
// CHECK: define [[A:%.*]]* @_ZN5test04testENS_1AE(
|
|
// CHECK: alloca
|
|
// CHECK-NEXT: getelementptr
|
|
// CHECK-NEXT: store
|
|
// CHECK-NEXT: call i8* @_Znwm(
|
|
// CHECK-NEXT: bitcast
|
|
// CHECK-NEXT: bitcast
|
|
// CHECK-NEXT: bitcast
|
|
// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(
|
|
// CHECK-NEXT: ret
|
|
A *test(A a) {
|
|
return new A(a);
|
|
}
|
|
}
|
|
|
|
|
|
// rdar://9780211
|
|
@protocol bork
|
|
@end
|
|
|
|
namespace test1 {
|
|
template<typename T> struct RetainPtr {
|
|
RetainPtr() {}
|
|
};
|
|
|
|
|
|
RetainPtr<id<bork> > x;
|
|
RetainPtr<id> y;
|
|
|
|
}
|