Deleted Added
full compact
TransGCAttrs.cpp (234353) TransGCAttrs.cpp (239462)
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"
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/Lex/Lexer.h"
12#include "clang/AST/ASTContext.h"
13#include "clang/Basic/SourceManager.h"
13#include "clang/Basic/SourceManager.h"
14#include "llvm/Support/SaveAndRestore.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"
15#include "clang/Sema/SemaDiagnostic.h"
16#include "llvm/ADT/SmallString.h"
17#include "llvm/ADT/TinyPtrVector.h"
18#include "llvm/Support/SaveAndRestore.h"
18
19using namespace clang;
20using namespace arcmt;
21using namespace trans;
22
23namespace {
24
25/// \brief Collects all the places where GC attributes __strong/__weak occur.

--- 105 unchanged lines hidden (view full) ---

131 return FD->hasBody();
132
133 if (ObjCContainerDecl *ContD = dyn_cast<ObjCContainerDecl>(D))
134 return hasObjCImpl(ContD);
135
136 if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) {
137 for (CXXRecordDecl::method_iterator
138 MI = RD->method_begin(), ME = RD->method_end(); MI != ME; ++MI) {
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) {
139 if ((*MI)->isOutOfLine())
140 if (MI->isOutOfLine())
140 return true;
141 }
142 return false;
143 }
144
145 return isMigratable(cast<Decl>(D->getDeclContext()));
146 }
147

--- 13 unchanged lines hidden (view full) ---

161 }
162
163 bool isInMainFile(Decl *D) {
164 if (!D)
165 return false;
166
167 for (Decl::redecl_iterator
168 I = D->redecls_begin(), E = D->redecls_end(); I != E; ++I)
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)
169 if (!isInMainFile((*I)->getLocation()))
170 if (!isInMainFile(I->getLocation()))
170 return false;
171
172 return true;
173 }
174
175 bool isInMainFile(SourceLocation Loc) {
176 if (Loc.isInvalid())
177 return false;

--- 181 unchanged lines hidden ---
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 ---