[cfe-commits] r134995 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Jul 12 11:37:24 PDT 2011
Author: d0k
Date: Tue Jul 12 13:37:23 2011
New Revision: 134995
URL: http://llvm.org/viewvc/llvm-project?rev=134995&view=rev
Log:
Add more compiler workarounds. Should fix the build with old GCCs and MSVC.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=134995&r1=134994&r2=134995&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Jul 12 13:37:23 2011
@@ -475,20 +475,24 @@
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);
More information about the cfe-commits
mailing list