summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 1b3e71b436b..fba1a531a2a 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -433,8 +433,9 @@ tryEmitSpecializedAllocInit(CodeGenFunction &CGF, const ObjCMessageExpr *OME) {
// Match the exact pattern '[[MyClass alloc] init]'.
Selector Sel = OME->getSelector();
- if (!OME->isInstanceMessage() || !OME->getType()->isObjCObjectPointerType() ||
- !Sel.isUnarySelector() || Sel.getNameForSlot(0) != "init")
+ if (OME->getReceiverKind() != ObjCMessageExpr::Instance ||
+ !OME->getType()->isObjCObjectPointerType() || !Sel.isUnarySelector() ||
+ Sel.getNameForSlot(0) != "init")
return None;
// Okay, this is '[receiver init]', check if 'receiver' is '[cls alloc]'.
OpenPOWER on IntegriCloud