summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-12 18:37:23 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-12 18:37:23 +0000
commitae2d344384f21b6f360a3af7655c68c25596a2d7 (patch)
tree10a89e5885d68fc45aef09c87e2501a404520276 /clang
parent660e29828b738ddbf65f515a036c21bea3cf70a7 (diff)
downloadbcm5719-llvm-ae2d344384f21b6f360a3af7655c68c25596a2d7.tar.gz
bcm5719-llvm-ae2d344384f21b6f360a3af7655c68c25596a2d7.zip
Add more compiler workarounds. Should fix the build with old GCCs and MSVC.
llvm-svn: 134995
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 90bdd5caf6c..1d955041dd8 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud