diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-12 17:25:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-12 17:25:51 +0000 |
commit | 509a32da75a82e894562f862ad1f27bf9dfb9c12 (patch) | |
tree | 91b9283f8283e49cbf9f3a39c0b7a14efe5841e1 /clang | |
parent | 5ff40fc7ab7ab9fcb42ad1dd66e2a43479177119 (diff) | |
download | bcm5719-llvm-509a32da75a82e894562f862ad1f27bf9dfb9c12.tar.gz bcm5719-llvm-509a32da75a82e894562f862ad1f27bf9dfb9c12.zip |
fix PR6819
llvm-svn: 101050
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 10 | ||||
-rw-r--r-- | clang/test/CodeGenObjC/metadata-symbols-64.m | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index b933e72aa2b..26d115667c5 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -499,6 +499,7 @@ ActOnClassMessage(Scope *S, IdentifierInfo *receiverName, Selector Sel, Expr **ArgExprs = reinterpret_cast<Expr **>(Args); ObjCInterfaceDecl *ClassDecl = 0; + bool isSuper = false; // Special case a message to super, which can be either a class message or an // instance message, depending on what CurMethodDecl is. @@ -523,6 +524,7 @@ ActOnClassMessage(Scope *S, IdentifierInfo *receiverName, Selector Sel, // Otherwise, if this is a class method, try dispatching to our // superclass, which is in ClassDecl. + isSuper = true; } } @@ -583,6 +585,14 @@ ActOnClassMessage(Scope *S, IdentifierInfo *receiverName, Selector Sel, returnType = returnType.getNonReferenceType(); + // FIXME: need to do a better job handling 'super' usage within a class. For + // now, we simply pass the "super" identifier through (which isn't consistent + // with instance methods. + if (isSuper) + return new (Context) ObjCMessageExpr(Context, receiverName, receiverLoc, + Sel, returnType, Method, lbrac, rbrac, + ArgExprs, NumArgs); + // If we have the ObjCInterfaceDecl* for the class that is receiving the // message, use that to construct the ObjCMessageExpr. Otherwise pass on the // IdentifierInfo* for the class. diff --git a/clang/test/CodeGenObjC/metadata-symbols-64.m b/clang/test/CodeGenObjC/metadata-symbols-64.m index b319ce58678..886d53a8287 100644 --- a/clang/test/CodeGenObjC/metadata-symbols-64.m +++ b/clang/test/CodeGenObjC/metadata-symbols-64.m @@ -1,11 +1,12 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o %t %s // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && + // RUN: grep '@"OBJC_CLASS_$_A" = global' %t // RUN: grep '@"OBJC_CLASS_$_B" = external global' %t // RUN: grep '@"OBJC_IVAR_$_A._ivar" = global .* section "__DATA, __objc_const", align 8' %t // RUN: grep '@"OBJC_METACLASS_$_A" = global .* section "__DATA, __objc_data", align 8' %t // RUN: grep '@"\\01L_OBJC_CLASSLIST_REFERENCES_$_[0-9]*" = internal global .* section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8' %t -// RUN: grep '@"\\01L_OBJC_CLASSLIST_SUP_REFS_$_[0-9]*" = internal global .* section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8' %t | count 1 +// RUN: grep '@"\\01L_OBJC_CLASSLIST_SUP_REFS_$_[0-9]*" = internal global .* section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8' %t | count 2 // RUN: grep '@"\\01L_OBJC_CLASS_NAME_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t // RUN: grep '@"\\01L_OBJC_LABEL_CATEGORY_$" = internal global .* section "__DATA, __objc_catlist, regular, no_dead_strip", align 8' %t // RUN: grep '@"\\01L_OBJC_LABEL_CLASS_$" = internal global .* section "__DATA, __objc_classlist, regular, no_dead_strip", align 8' %t |