mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-26 23:09:03 -04:00

Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. llvm-svn: 213386
20 lines
356 B
Plaintext
20 lines
356 B
Plaintext
// RUN: %clang_cc1 -triple x86_64 -emit-llvm -o - %s | FileCheck %s
|
|
|
|
@protocol P1 @end
|
|
@interface NSOperationQueue
|
|
{
|
|
char ch[64];
|
|
double d;
|
|
}
|
|
@end
|
|
|
|
NSOperationQueue &f();
|
|
NSOperationQueue<P1> &f1();
|
|
|
|
void call_once() {
|
|
f();
|
|
f1();
|
|
}
|
|
// CHECK: call dereferenceable({{[0-9]+}}) %0* @_Z1fv()
|
|
// CHECK: call dereferenceable({{[0-9]+}}) %0* @_Z2f1v()
|