Generalize Cleanup::Emit's "isForEH" parameter into a set
of flags. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134997 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 05f5f4c..f64ff97 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -218,7 +218,7 @@
namespace {
struct FinishARCDealloc : EHScopeStack::Cleanup {
- void Emit(CodeGenFunction &CGF, bool isForEH) {
+ void Emit(CodeGenFunction &CGF, Flags flags) {
const ObjCMethodDecl *method = cast<ObjCMethodDecl>(CGF.CurCodeDecl);
const ObjCImplementationDecl *impl
= cast<ObjCImplementationDecl>(method->getDeclContext());
@@ -691,11 +691,11 @@
: addr(addr), ivar(ivar), destroyer(*destroyer),
useEHCleanupForArray(useEHCleanupForArray) {}
- void Emit(CodeGenFunction &CGF, bool isForEH) {
+ void Emit(CodeGenFunction &CGF, Flags flags) {
LValue lvalue
= CGF.EmitLValueForIvar(CGF.TypeOfSelfObject(), addr, ivar, /*CVR*/ 0);
CGF.emitDestroy(lvalue.getAddress(), ivar->getType(), destroyer,
- !isForEH && useEHCleanupForArray);
+ flags.isForNormalCleanup() && useEHCleanupForArray);
}
};
}
@@ -1213,7 +1213,7 @@
llvm::Value *ptr;
llvm::Value *condition;
- void Emit(CodeGenFunction &CGF, bool forEH) {
+ void Emit(CodeGenFunction &CGF, Flags flags) {
llvm::Value *object;
// If we're in a conditional branch, we had to stash away in an
@@ -1802,7 +1802,7 @@
CallObjCAutoreleasePoolObject(llvm::Value *token) : Token(token) {}
- void Emit(CodeGenFunction &CGF, bool isForEH) {
+ void Emit(CodeGenFunction &CGF, Flags flags) {
CGF.EmitObjCAutoreleasePoolPop(Token);
}
};
@@ -1811,7 +1811,7 @@
CallObjCMRRAutoreleasePoolObject(llvm::Value *token) : Token(token) {}
- void Emit(CodeGenFunction &CGF, bool isForEH) {
+ void Emit(CodeGenFunction &CGF, Flags flags) {
CGF.EmitObjCMRRAutoreleasePoolPop(Token);
}
};