diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2008-08-12 05:08:18 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-12 05:08:18 +0000 |
| commit | 98c5ead87d720d8b68b6f236c3c3579a388fc882 (patch) | |
| tree | 7e1eb2346062de43de2189ee1f87a883b39c004b /lib/CodeGen/CGExprScalar.cpp | |
| parent | a008db15ee50455ff98db1e4251cdda5c89a90ee (diff) | |
Protocol related tweaks
- Implement type conversion of ObjCQualifiedIdType
- Wire @protocol(...) to GenerateProtocolRef in ScalarExprEmitter
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index decf539f1c..294965498e 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -14,6 +14,7 @@ #include "CodeGenFunction.h" #include "CodeGenModule.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/DeclObjC.h" #include "clang/AST/StmtVisitor.h" #include "clang/Basic/TargetInfo.h" #include "llvm/Constants.h" @@ -135,6 +136,7 @@ public: } Value *VisitObjCMessageExpr(ObjCMessageExpr *E); Value *VisitObjCSelectorExpr(ObjCSelectorExpr *E); + Value *VisitObjCProtocolExpr(ObjCProtocolExpr *E); Value *VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) { return EmitLoadOfLValue(E);} Value *VisitArraySubscriptExpr(ArraySubscriptExpr *E); Value *VisitShuffleVectorExpr(ShuffleVectorExpr *E); @@ -506,6 +508,11 @@ Value *ScalarExprEmitter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) { return Runtime->GetSelector(Builder, E->getSelector()); } +Value *ScalarExprEmitter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) { + // FIXME: This should pass the Decl not the name. + return Runtime->GenerateProtocolRef(Builder, E->getProtocol()->getName()); +} + Value *ScalarExprEmitter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) { // Emit subscript expressions in rvalue context's. For most cases, this just // loads the lvalue formed by the subscript expr. However, we have to be |
