1//===--- TransGCAttrs.cpp - Transformations to ARC mode --------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#include "Transforms.h" 11#include "Internals.h" |
12#include "clang/AST/ASTContext.h" |
13#include "clang/Basic/SourceManager.h" |
14#include "clang/Lex/Lexer.h" |
15#include "clang/Sema/SemaDiagnostic.h" 16#include "llvm/ADT/SmallString.h" 17#include "llvm/ADT/TinyPtrVector.h" |
18#include "llvm/Support/SaveAndRestore.h" |
19 20using namespace clang; 21using namespace arcmt; 22using namespace trans; 23 24namespace { 25 26/// \brief Collects all the places where GC attributes __strong/__weak occur. --- 105 unchanged lines hidden (view full) --- 132 return FD->hasBody(); 133 134 if (ObjCContainerDecl *ContD = dyn_cast<ObjCContainerDecl>(D)) 135 return hasObjCImpl(ContD); 136 137 if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) { 138 for (CXXRecordDecl::method_iterator 139 MI = RD->method_begin(), ME = RD->method_end(); MI != ME; ++MI) { |
140 if (MI->isOutOfLine()) |
141 return true; 142 } 143 return false; 144 } 145 146 return isMigratable(cast<Decl>(D->getDeclContext())); 147 } 148 --- 13 unchanged lines hidden (view full) --- 162 } 163 164 bool isInMainFile(Decl *D) { 165 if (!D) 166 return false; 167 168 for (Decl::redecl_iterator 169 I = D->redecls_begin(), E = D->redecls_end(); I != E; ++I) |
170 if (!isInMainFile(I->getLocation())) |
171 return false; 172 173 return true; 174 } 175 176 bool isInMainFile(SourceLocation Loc) { 177 if (Loc.isInvalid()) 178 return false; --- 181 unchanged lines hidden --- |