forked from OSchip/llvm-project
Fixes an ObjC migrator crash when last decl
in file is an enum. llvm-svn: 186700
This commit is contained in:
parent
dece1a5c5c
commit
008ef72bee
|
@ -399,7 +399,7 @@ static bool rewriteToNSEnumDecl(const EnumDecl *EnumDcl,
|
|||
return false;
|
||||
}
|
||||
|
||||
void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx,
|
||||
void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx,
|
||||
const ObjCImplementationDecl *ImpDecl) {
|
||||
const ObjCInterfaceDecl *IDecl = ImpDecl->getClassInterface();
|
||||
if (!IDecl || ObjCProtocolDecls.empty())
|
||||
|
@ -514,8 +514,9 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
|
|||
else if (const EnumDecl *ED = dyn_cast<EnumDecl>(*D)) {
|
||||
DeclContext::decl_iterator N = D;
|
||||
++N;
|
||||
if (const TypedefDecl *TD = dyn_cast<TypedefDecl>(*N))
|
||||
migrateNSEnumDecl(Ctx, ED, TD);
|
||||
if (N != DEnd)
|
||||
if (const TypedefDecl *TD = dyn_cast<TypedefDecl>(*N))
|
||||
migrateNSEnumDecl(Ctx, ED, TD);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,3 +27,8 @@ enum {
|
|||
|
||||
typedef NSUInteger UITableViewCellStyle;
|
||||
|
||||
enum {
|
||||
UNOne,
|
||||
UNTwo
|
||||
};
|
||||
|
||||
|
|
|
@ -27,3 +27,8 @@ typedef NS_OPTIONS(NSUInteger, UITableViewCellStyle) {
|
|||
|
||||
|
||||
|
||||
enum {
|
||||
UNOne,
|
||||
UNTwo
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue