diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2013-08-27 23:56:54 +0000 | 
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-08-27 23:56:54 +0000 | 
| commit | 7ca1d30e4933da7070fbbed8eab016d187096f18 (patch) | |
| tree | b4a4541c59abcad457bff71933ff00e4ad9aea9b | |
| parent | 9d1daa87e71c57a1730b9e554275a11e750632a4 (diff) | |
| download | bcm5719-llvm-7ca1d30e4933da7070fbbed8eab016d187096f18.tar.gz bcm5719-llvm-7ca1d30e4933da7070fbbed8eab016d187096f18.zip | |
ObjectiveC migrator: minor refactoring of my last
cf annotation patch.
llvm-svn: 189420
| -rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 20 | 
1 files changed, 10 insertions, 10 deletions
| diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 4fa4b1e6606..56a042f7ff0 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -57,9 +57,9 @@ class ObjCMigrateASTConsumer : public ASTConsumer {    void migrateCFAnnotation(ASTContext &Ctx, const Decl *Decl);    void AddCFAnnotations(ASTContext &Ctx, const CallEffects &CE, -                        const FunctionDecl *FuncDecl); +                        const FunctionDecl *FuncDecl, bool ResultAnnotated);    void AddCFAnnotations(ASTContext &Ctx, const CallEffects &CE, -                        const ObjCMethodDecl *MethodDecl); +                        const ObjCMethodDecl *MethodDecl, bool ResultAnnotated);    void AnnotateImplicitBridging(ASTContext &Ctx); @@ -868,10 +868,10 @@ void ObjCMigrateASTConsumer::migrateCFAnnotation(ASTContext &Ctx, const Decl *De  void ObjCMigrateASTConsumer::AddCFAnnotations(ASTContext &Ctx,                                                const CallEffects &CE, -                                              const FunctionDecl *FuncDecl) { +                                              const FunctionDecl *FuncDecl, +                                              bool ResultAnnotated) {    // Annotate function. -  if (!FuncDecl->getAttr<CFReturnsRetainedAttr>() && -      !FuncDecl->getAttr<CFReturnsNotRetainedAttr>()) { +  if (!ResultAnnotated) {      RetEffect Ret = CE.getReturnValue();      const char *AnnotationString = 0;      if (Ret.getObjKind() == RetEffect::CF && Ret.isOwned()) { @@ -947,7 +947,7 @@ ObjCMigrateASTConsumer::CF_BRIDGING_KIND      else {        QualType AT = pd->getType();        if (!AuditedType(AT)) { -        AddCFAnnotations(Ctx, CE, FuncDecl); +        AddCFAnnotations(Ctx, CE, FuncDecl, FuncIsReturnAnnotated);          return CF_BRIDGING_NONE;        }      } @@ -974,10 +974,10 @@ void ObjCMigrateASTConsumer::migrateARCSafeAnnotation(ASTContext &Ctx,  void ObjCMigrateASTConsumer::AddCFAnnotations(ASTContext &Ctx,                                                const CallEffects &CE, -                                              const ObjCMethodDecl *MethodDecl) { +                                              const ObjCMethodDecl *MethodDecl, +                                              bool ResultAnnotated) {    // Annotate function. -  if (!MethodDecl->getAttr<CFReturnsRetainedAttr>() && -      !MethodDecl->getAttr<CFReturnsNotRetainedAttr>()) { +  if (!ResultAnnotated) {      RetEffect Ret = CE.getReturnValue();      const char *AnnotationString = 0;      if (Ret.getObjKind() == RetEffect::CF && Ret.isOwned()) { @@ -1052,7 +1052,7 @@ ObjCMigrateASTConsumer::CF_BRIDGING_KIND      else {        QualType AT = pd->getType();        if (!AuditedType(AT)) { -        AddCFAnnotations(Ctx, CE, MethodDecl); +        AddCFAnnotations(Ctx, CE, MethodDecl, MethodIsReturnAnnotated);          return CF_BRIDGING_NONE;        }      } | 

