diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-12 18:37:23 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-12 18:37:23 +0000 |
commit | 0d516767a3af70538a40a297577960034e6ad66f (patch) | |
tree | 90b60f8ffaef6ed15b40d56e1644cb91799e5e40 /lib/CodeGen/CGExpr.cpp | |
parent | f96e904783dc28b2b3fa4dcbb6dbdb40ca26aa8d (diff) |
Add more compiler workarounds. Should fix the build with old GCCs and MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134995 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 90bdd5caf6..1d955041dd 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -475,20 +475,24 @@ CodeGenFunction::EmitReferenceBindingToExpr(const Expr *E, case Qualifiers::OCL_Strong: { bool precise = VD && VD->hasAttr<ObjCPreciseLifetimeAttr>(); CleanupKind cleanupKind = getARCCleanupKind(); - pushDestroy(cleanupKind, ReferenceTemporary, - ObjCARCReferenceLifetimeType, - precise ? destroyARCStrongPrecise : destroyARCStrongImprecise, - cleanupKind & EHCleanup); + // This local is a GCC and MSVC compiler workaround. + Destroyer *destroyer = precise ? &destroyARCStrongPrecise : + &destroyARCStrongImprecise; + pushDestroy(cleanupKind, ReferenceTemporary, ObjCARCReferenceLifetimeType, + *destroyer, cleanupKind & EHCleanup); break; } - case Qualifiers::OCL_Weak: + 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, destroyARCWeak, true); + ObjCARCReferenceLifetimeType, *destroyer, true); break; } + } } return RValue::get(Value); |