From 516bbd42e62d709013824d6fb8445a0cfda3129a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 26 Jan 2012 03:33:36 +0000 Subject: Use function pointers, rather than references, to pass Destroyers around, in the process cleaning up the various gcc/msvc compiler workarounds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149036 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 41fbb836b5..0e19a4015a 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -487,21 +487,17 @@ CodeGenFunction::EmitReferenceBindingToExpr(const Expr *E, case Qualifiers::OCL_Strong: { bool precise = VD && VD->hasAttr(); CleanupKind cleanupKind = getARCCleanupKind(); - // This local is a GCC and MSVC compiler workaround. - Destroyer *destroyer = precise ? &destroyARCStrongPrecise : - &destroyARCStrongImprecise; pushDestroy(cleanupKind, ReferenceTemporary, ObjCARCReferenceLifetimeType, - *destroyer, cleanupKind & EHCleanup); + precise ? destroyARCStrongPrecise : destroyARCStrongImprecise, + cleanupKind & EHCleanup); break; } case Qualifiers::OCL_Weak: { - // This local is a GCC and MSVC compiler workaround. - Destroyer *destroyer = &destroyARCWeak; // __weak objects always get EH cleanups; otherwise, exceptions // could cause really nasty crashes instead of mere leaks. pushDestroy(NormalAndEHCleanup, ReferenceTemporary, - ObjCARCReferenceLifetimeType, *destroyer, true); + ObjCARCReferenceLifetimeType, destroyARCWeak, true); break; } } -- cgit v1.2.3