forked from OSchip/llvm-project
Add more compiler workarounds. Should fix the build with old GCCs and MSVC.
llvm-svn: 134995
This commit is contained in:
parent
660e29828b
commit
ae2d344384
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue