clang: lib/ARCMigrate/ObjCMT.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
Diagnostic wrappers for TextAPI types for error reporting.
Functions
static void append_attr (std::string &PropertyString, const char *attr, bool &LParenAdded)
static void MigrateBlockOrFunctionPointerTypeVariable (std::string &PropertyString, const std::string &TypeString, const char *name)
static const char * PropertyMemoryAttribute (ASTContext &Context, QualType ArgType)
static void rewriteToObjCProperty (const ObjCMethodDecl *Getter, const ObjCMethodDecl *Setter, const NSAPI &NS, edit::Commit &commit, unsigned LengthOfPrefix, bool Atomic, bool UseNsIosOnlyMacro, bool AvailabilityArgsMatch)
static bool IsCategoryNameWithDeprecatedSuffix (ObjCContainerDecl *D)
static bool ClassImplementsAllMethodsAndProperties (ASTContext &Ctx, const ObjCImplementationDecl *ImpDecl, const ObjCInterfaceDecl *IDecl, ObjCProtocolDecl *Protocol)
static bool rewriteToObjCInterfaceDecl (const ObjCInterfaceDecl *IDecl, llvm::SmallVectorImpl< ObjCProtocolDecl * > &ConformingProtocols, const NSAPI &NS, edit::Commit &commit)
static StringRef GetUnsignedName (StringRef NSIntegerName)
static bool rewriteToNSEnumDecl (const EnumDecl *EnumDcl, const TypedefDecl *TypedefDcl, const NSAPI &NS, edit::Commit &commit, StringRef NSIntegerName, bool NSOptions)
static void rewriteToNSMacroDecl (ASTContext &Ctx, const EnumDecl *EnumDcl, const TypedefDecl *TypedefDcl, const NSAPI &NS, edit::Commit &commit, bool IsNSIntegerType)
static bool UseNSOptionsMacro (Preprocessor &PP, ASTContext &Ctx, const EnumDecl *EnumDcl)
static void ReplaceWithInstancetype (ASTContext &Ctx, const ObjCMigrateASTConsumer &ASTC, ObjCMethodDecl *OM)
static void ReplaceWithClasstype (const ObjCMigrateASTConsumer &ASTC, ObjCMethodDecl *OM)
static bool TypeIsInnerPointer (QualType T)
static bool versionsMatch (const VersionTuple &X, const VersionTuple &Y)
Check whether the two versions match.
static bool AvailabilityAttrsMatch (Attr *At1, Attr *At2)
AvailabilityAttrsMatch - This routine checks that if comparing two availability attributes, all their components match.
static bool MatchTwoAttributeLists (const AttrVec &Attrs1, const AttrVec &Attrs2, bool &AvailabilityArgsMatch)
static bool AttributesMatch (const Decl *Decl1, const Decl *Decl2, bool &AvailabilityArgsMatch)
AttributesMatch - This routine checks list of attributes for two decls.
static bool IsValidIdentifier (ASTContext &Ctx, const char *Name)
static bool IsVoidStarType (QualType Ty)
static bool AuditedType (QualType AT)
AuditedType - This routine audits the type AT and returns false if it is one of known CF object types or of the "void *" variety.
static bool hasSuperInitCall (const ObjCMethodDecl *MD)
static std::vector< std::string > getAllowListFilenames (StringRef DirPath)
static bool reportDiag (const Twine &Err, DiagnosticsEngine &Diag)
static std::string applyEditsToTemp (FileEntryRef FE, ArrayRef< EditEntry > Edits, FileManager &FileMgr, DiagnosticsEngine &Diag)

append_attr()

static void append_attr ( std::string & PropertyString, const char * attr, bool & LParenAdded ) static

applyEditsToTemp()

Definition at line 2150 of file ObjCMT.cpp.

References clang::edit::EditedSource::applyRewrites(), clang::SrcMgr::C_User, clang::edit::EditedSource::commit(), Diag(), E, clang::CharSourceRange::getCharRange(), clang::FileEntryRef::getName(), clang::Rewriter::getRewriteBufferFor(), clang::edit::Commit::insert(), clang::edit::Commit::remove(), clang::edit::Commit::replace(), reportDiag(), and SM.

Referenced by clang::arcmt::getFileRemappingsFromFileList().

AttributesMatch()

static bool AttributesMatch ( const Decl * Decl1, const Decl * Decl2, bool & AvailabilityArgsMatch ) static

AuditedType()

AvailabilityAttrsMatch()

static bool AvailabilityAttrsMatch ( Attr * At1, Attr * At2 ) static

AvailabilityAttrsMatch - This routine checks that if comparing two availability attributes, all their components match.

It returns true, if not dealing with availability or when all components of availability attributes match. This routine is only called when the attributes are of the same kind.

Definition at line 1078 of file ObjCMT.cpp.

References versionsMatch().

Referenced by MatchTwoAttributeLists().

ClassImplementsAllMethodsAndProperties()

getAllowListFilenames()

static std::vector< std::string > getAllowListFilenames ( StringRef DirPath) static

GetUnsignedName()

static StringRef GetUnsignedName ( StringRef NSIntegerName) static

hasSuperInitCall()

IsCategoryNameWithDeprecatedSuffix()

IsValidIdentifier()

static bool IsValidIdentifier ( ASTContext & Ctx, const char * Name ) static

IsVoidStarType()

MatchTwoAttributeLists()

static bool MatchTwoAttributeLists ( const AttrVec & Attrs1, const AttrVec & Attrs2, bool & AvailabilityArgsMatch ) static

MigrateBlockOrFunctionPointerTypeVariable()

static void MigrateBlockOrFunctionPointerTypeVariable ( std::string & PropertyString, const std::string & TypeString, const char * name ) static

PropertyMemoryAttribute()

static const char * PropertyMemoryAttribute ( ASTContext & Context, QualType ArgType ) static

ReplaceWithClasstype()

static void ReplaceWithClasstype ( const ObjCMigrateASTConsumer & ASTC, ObjCMethodDecl * OM ) static

ReplaceWithInstancetype()

static void ReplaceWithInstancetype ( ASTContext & Ctx, const ObjCMigrateASTConsumer & ASTC, ObjCMethodDecl * OM ) static

reportDiag()

rewriteToNSEnumDecl()

Definition at line 703 of file ObjCMT.cpp.

References clang::arcmt::trans::findLocationAfterSemi(), clang::arcmt::trans::findSemiAfterLocation(), clang::NSAPI::getASTContext(), clang::TypeDecl::getBeginLoc(), clang::Decl::getEndLoc(), clang::NamedDecl::getIdentifier(), clang::SourceLocation::getLocWithOffset(), clang::IdentifierInfo::getName(), GetUnsignedName(), clang::edit::Commit::insertFromRange(), clang::SourceLocation::isValid(), clang::edit::Commit::remove(), and clang::edit::Commit::replace().

rewriteToNSMacroDecl()

Definition at line 757 of file ObjCMT.cpp.

References clang::QualType::getAsString(), clang::SourceRange::getBegin(), clang::TypeDecl::getBeginLoc(), clang::TagDecl::getBraceRange(), clang::CharSourceRange::getCharRange(), clang::Decl::getEndLoc(), clang::NamedDecl::getIdentifier(), clang::EnumDecl::getIntegerType(), clang::SourceLocation::getLocWithOffset(), clang::IdentifierInfo::getName(), clang::ASTContext::getPrintingPolicy(), clang::SourceLocation::isInvalid(), clang::QualType::isNull(), clang::edit::Commit::remove(), and clang::edit::Commit::replace().

rewriteToObjCInterfaceDecl()

rewriteToObjCProperty()

Definition at line 453 of file ObjCMT.cpp.

References append_attr(), clang::Atomic, clang::Type::getAs(), clang::QualType::getAsString(), clang::NSAPI::getASTContext(), clang::ObjCMethodDecl::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::CharSourceRange::getCharRange(), clang::ObjCMethodDecl::getDeclaratorEndLoc(), clang::SourceLocation::getLocWithOffset(), clang::NamedDecl::getNameAsString(), clang::Selector::getNameForSlot(), clang::ASTContext::getPrintingPolicy(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCMethodDecl::getSelector(), clang::ObjCMethodDecl::getSelectorStartLoc(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::Qualifiers::hasObjCLifetime(), clang::Type::isBlockPointerType(), clang::Type::isFunctionPointerType(), clang::NSAPI::isMacroDefined(), clang::Type::isRealType(), clang::isUppercase(), MigrateBlockOrFunctionPointerTypeVariable(), clang::ObjCMethodDecl::param_begin(), PropertyMemoryAttribute(), clang::edit::Commit::remove(), clang::Qualifiers::removeObjCLifetime(), clang::edit::Commit::replace(), clang::PrintingPolicy::SuppressLifetimeQualifiers, clang::PrintingPolicy::SuppressStrongLifetime, and clang::toLowercase().

TypeIsInnerPointer()

Definition at line 1044 of file ObjCMT.cpp.

References clang::Type::getAs(), clang::RecordType::getDecl(), clang::PointerType::getPointeeType(), clang::QualType::getUnqualifiedType(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::ento::coreFoundation::isCFObjectRef(), clang::TagDecl::isCompleteDefinition(), clang::Type::isFunctionPointerType(), clang::Type::isObjCBuiltinType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), and clang::T.

UseNSOptionsMacro()

versionsMatch()

static bool versionsMatch ( const VersionTuple & X, const VersionTuple & Y ) static