diff options
Diffstat (limited to 'clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp')
| -rw-r--r-- | clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp index 94bd2befd0b2..1f40db785981 100644 --- a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -600,8 +600,8 @@ namespace { StringLiteral *getStringLiteral(StringRef Str) { QualType StrType = Context->getConstantArrayType( Context->CharTy, llvm::APInt(32, Str.size() + 1), nullptr, - ArrayType::Normal, 0); - return StringLiteral::Create(*Context, Str, StringLiteral::Ordinary, + ArraySizeModifier::Normal, 0); + return StringLiteral::Create(*Context, Str, StringLiteralKind::Ordinary, /*Pascal=*/false, StrType, SourceLocation()); } }; @@ -864,9 +864,9 @@ RewriteModernObjC::getIvarAccessString(ObjCIvarDecl *D) { CDecl = CatDecl->getClassInterface(); std::string RecName = std::string(CDecl->getName()); RecName += "_IMPL"; - RecordDecl *RD = - RecordDecl::Create(*Context, TTK_Struct, TUDecl, SourceLocation(), - SourceLocation(), &Context->Idents.get(RecName)); + RecordDecl *RD = RecordDecl::Create(*Context, TagTypeKind::Struct, TUDecl, + SourceLocation(), SourceLocation(), + &Context->Idents.get(RecName)); QualType PtrStructIMPL = Context->getPointerType(Context->getTagDeclType(RD)); unsigned UnsignedIntSize = static_cast<unsigned>(Context->getTypeSize(Context->UnsignedIntTy)); @@ -2978,9 +2978,9 @@ Stmt *RewriteModernObjC::RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral // }; QualType RewriteModernObjC::getSuperStructType() { if (!SuperStructDecl) { - SuperStructDecl = RecordDecl::Create(*Context, TTK_Struct, TUDecl, - SourceLocation(), SourceLocation(), - &Context->Idents.get("__rw_objc_super")); + SuperStructDecl = RecordDecl::Create( + *Context, TagTypeKind::Struct, TUDecl, SourceLocation(), + SourceLocation(), &Context->Idents.get("__rw_objc_super")); QualType FieldTypes[2]; // struct objc_object *object; @@ -3006,9 +3006,9 @@ QualType RewriteModernObjC::getSuperStructType() { QualType RewriteModernObjC::getConstantStringStructType() { if (!ConstantStringDecl) { - ConstantStringDecl = RecordDecl::Create(*Context, TTK_Struct, TUDecl, - SourceLocation(), SourceLocation(), - &Context->Idents.get("__NSConstantStringImpl")); + ConstantStringDecl = RecordDecl::Create( + *Context, TagTypeKind::Struct, TUDecl, SourceLocation(), + SourceLocation(), &Context->Idents.get("__NSConstantStringImpl")); QualType FieldTypes[4]; // struct objc_object *receiver; @@ -3782,10 +3782,9 @@ QualType RewriteModernObjC::SynthesizeBitfieldGroupStructType( SmallVectorImpl<ObjCIvarDecl *> &IVars) { std::string StructTagName; ObjCIvarBitfieldGroupType(IV, StructTagName); - RecordDecl *RD = RecordDecl::Create(*Context, TTK_Struct, - Context->getTranslationUnitDecl(), - SourceLocation(), SourceLocation(), - &Context->Idents.get(StructTagName)); + RecordDecl *RD = RecordDecl::Create( + *Context, TagTypeKind::Struct, Context->getTranslationUnitDecl(), + SourceLocation(), SourceLocation(), &Context->Idents.get(StructTagName)); for (unsigned i=0, e = IVars.size(); i < e; i++) { ObjCIvarDecl *Ivar = IVars[i]; RD->addDecl(FieldDecl::Create(*Context, RD, SourceLocation(), SourceLocation(), @@ -4588,7 +4587,7 @@ Stmt *RewriteModernObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FT); // FTP will be null for closures that don't take arguments. - RecordDecl *RD = RecordDecl::Create(*Context, TTK_Struct, TUDecl, + RecordDecl *RD = RecordDecl::Create(*Context, TagTypeKind::Struct, TUDecl, SourceLocation(), SourceLocation(), &Context->Idents.get("__block_impl")); QualType PtrBlock = Context->getPointerType(Context->getTagDeclType(RD)); @@ -5347,9 +5346,9 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp, RewriteByRefString(RecName, Name, ND, true); IdentifierInfo *II = &Context->Idents.get(RecName.c_str() + sizeof("struct")); - RecordDecl *RD = RecordDecl::Create(*Context, TTK_Struct, TUDecl, - SourceLocation(), SourceLocation(), - II); + RecordDecl *RD = + RecordDecl::Create(*Context, TagTypeKind::Struct, TUDecl, + SourceLocation(), SourceLocation(), II); assert(RD && "SynthBlockInitExpr(): Can't find RecordDecl"); QualType castT = Context->getPointerType(Context->getTagDeclType(RD)); @@ -6855,7 +6854,7 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, std::vector<ObjCMethodDecl *> InstanceMethods, ClassMethods; std::vector<ObjCMethodDecl *> OptInstanceMethods, OptClassMethods; for (auto *MD : PDecl->instance_methods()) { - if (MD->getImplementationControl() == ObjCMethodDecl::Optional) { + if (MD->getImplementationControl() == ObjCImplementationControl::Optional) { OptInstanceMethods.push_back(MD); } else { InstanceMethods.push_back(MD); @@ -6863,7 +6862,7 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, } for (auto *MD : PDecl->class_methods()) { - if (MD->getImplementationControl() == ObjCMethodDecl::Optional) { + if (MD->getImplementationControl() == ObjCImplementationControl::Optional) { OptClassMethods.push_back(MD); } else { ClassMethods.push_back(MD); @@ -7508,8 +7507,8 @@ Stmt *RewriteModernObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) { std::string RecName = std::string(CDecl->getName()); RecName += "_IMPL"; RecordDecl *RD = RecordDecl::Create( - *Context, TTK_Struct, TUDecl, SourceLocation(), SourceLocation(), - &Context->Idents.get(RecName)); + *Context, TagTypeKind::Struct, TUDecl, SourceLocation(), + SourceLocation(), &Context->Idents.get(RecName)); QualType PtrStructIMPL = Context->getPointerType(Context->getTagDeclType(RD)); unsigned UnsignedIntSize = static_cast<unsigned>(Context->getTypeSize(Context->UnsignedIntTy)); |
