IRGen support for functions returning objc object

types. Fixes PR7865.

llvm-svn: 110832
This commit is contained in:
Fariborz Jahanian 2010-08-11 17:37:35 +00:00
parent a5f923b1a1
commit d539d098a4
4 changed files with 21 additions and 10 deletions

View File

@ -77,7 +77,7 @@ const llvm::Type *CodeGenFunction::ConvertType(QualType T) {
bool CodeGenFunction::hasAggregateLLVMType(QualType T) {
return T->isRecordType() || T->isArrayType() || T->isAnyComplexType() ||
T->isMemberFunctionPointerType();
T->isMemberFunctionPointerType() || T->isObjCObjectType();
}
void CodeGenFunction::EmitReturnBlock() {

View File

@ -30,15 +30,6 @@ using namespace clang;
Sema::OwningStmtResult Sema::ActOnExprStmt(FullExprArg expr) {
Expr *E = expr->takeAs<Expr>();
assert(E && "ActOnExprStmt(): missing expression");
if (E->getType()->isObjCObjectType()) {
if (LangOpts.ObjCNonFragileABI)
Diag(E->getLocEnd(), diag::err_indirection_requires_nonfragile_object)
<< E->getType();
else
Diag(E->getLocEnd(), diag::err_direct_interface_unsupported)
<< E->getType();
return StmtError();
}
// C99 6.8.3p2: The expression in an expression statement is evaluated as a
// void expression for its side effects. Conversion to void allows any
// operand, even incomplete types.

View File

@ -0,0 +1,19 @@
// 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 %0* @_Z1fv()
// CHECK: call %0* @_Z2f1v()

View File

@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fobjc-nonfragile-abi -verify -fsyntax-only %s
// XFAIL: *
@interface NSView
- (id)initWithView:(id)realView;