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.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index f64ff9766f9..426cca00140 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -220,11 +220,13 @@ namespace {
struct FinishARCDealloc : EHScopeStack::Cleanup {
void Emit(CodeGenFunction &CGF, Flags flags) {
const ObjCMethodDecl *method = cast<ObjCMethodDecl>(CGF.CurCodeDecl);
- const ObjCImplementationDecl *impl
- = cast<ObjCImplementationDecl>(method->getDeclContext());
+
+ const ObjCImplDecl *impl = cast<ObjCImplDecl>(method->getDeclContext());
const ObjCInterfaceDecl *iface = impl->getClassInterface();
if (!iface->getSuperClass()) return;
+ bool isCategory = isa<ObjCCategoryImplDecl>(impl);
+
// Call [super dealloc] if we have a superclass.
llvm::Value *self = CGF.LoadObjCSelf();
@@ -233,7 +235,7 @@ struct FinishARCDealloc : EHScopeStack::Cleanup {
CGF.getContext().VoidTy,
method->getSelector(),
iface,
- /*is category*/ false,
+ isCategory,
self,
/*is class msg*/ false,
args,
OpenPOWER on IntegriCloud