[arcmt] The hard-coded list of weak-incompatible classes is no longer necessary.

rdar://10673816

llvm-svn: 152879
This commit is contained in:
Argyrios Kyrtzidis 2012-03-16 00:21:22 +00:00
parent 99282b783e
commit ecbe8b4fab
1 changed files with 0 additions and 38 deletions

View File

@ -29,42 +29,6 @@ ASTTraverser::~ASTTraverser() { }
// Helpers. // Helpers.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// \brief True if the class is one that does not support weak.
static bool isClassInWeakBlacklist(ObjCInterfaceDecl *cls) {
if (!cls)
return false;
bool inList = llvm::StringSwitch<bool>(cls->getName())
.Case("NSColorSpace", true)
.Case("NSFont", true)
.Case("NSFontPanel", true)
.Case("NSImage", true)
.Case("NSLazyBrowserCell", true)
.Case("NSWindow", true)
.Case("NSWindowController", true)
.Case("NSViewController", true)
.Case("NSMenuView", true)
.Case("NSPersistentUIWindowInfo", true)
.Case("NSTableCellView", true)
.Case("NSATSTypeSetter", true)
.Case("NSATSGlyphStorage", true)
.Case("NSLineFragmentRenderingContext", true)
.Case("NSAttributeDictionary", true)
.Case("NSParagraphStyle", true)
.Case("NSTextTab", true)
.Case("NSSimpleHorizontalTypesetter", true)
.Case("_NSCachedAttributedString", true)
.Case("NSStringDrawingTextStorage", true)
.Case("NSTextView", true)
.Case("NSSubTextStorage", true)
.Default(false);
if (inList)
return true;
return isClassInWeakBlacklist(cls->getSuperClass());
}
bool trans::canApplyWeak(ASTContext &Ctx, QualType type, bool trans::canApplyWeak(ASTContext &Ctx, QualType type,
bool AllowOnUnknownClass) { bool AllowOnUnknownClass) {
if (!Ctx.getLangOpts().ObjCRuntimeHasWeak) if (!Ctx.getLangOpts().ObjCRuntimeHasWeak)
@ -88,8 +52,6 @@ bool trans::canApplyWeak(ASTContext &Ctx, QualType type,
return false; // forward classes are not verifiable, therefore not safe. return false; // forward classes are not verifiable, therefore not safe.
if (Class->isArcWeakrefUnavailable()) if (Class->isArcWeakrefUnavailable())
return false; return false;
if (isClassInWeakBlacklist(Class))
return false;
} }
return true; return true;