Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 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" |
| 13 | #include "clang/Basic/SourceManager.h" |
| 14 | #include "clang/Analysis/Support/SaveAndRestore.h" |
Argyrios Kyrtzidis | 12192cf | 2011-11-07 18:40:29 +0000 | [diff] [blame] | 15 | #include "clang/Sema/SemaDiagnostic.h" |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 16 | #include "llvm/ADT/TinyPtrVector.h" |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 17 | |
| 18 | using namespace clang; |
| 19 | using namespace arcmt; |
| 20 | using namespace trans; |
| 21 | |
| 22 | namespace { |
| 23 | |
| 24 | /// \brief Collects all the places where GC attributes __strong/__weak occur. |
| 25 | class GCAttrsCollector : public RecursiveASTVisitor<GCAttrsCollector> { |
| 26 | MigrationContext &MigrateCtx; |
| 27 | bool FullyMigratable; |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 28 | std::vector<ObjCPropertyDecl *> &AllProps; |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 29 | |
| 30 | typedef RecursiveASTVisitor<GCAttrsCollector> base; |
| 31 | public: |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 32 | GCAttrsCollector(MigrationContext &ctx, |
| 33 | std::vector<ObjCPropertyDecl *> &AllProps) |
| 34 | : MigrateCtx(ctx), FullyMigratable(false), |
| 35 | AllProps(AllProps) { } |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 36 | |
| 37 | bool shouldWalkTypesOfTypeLocs() const { return false; } |
| 38 | |
| 39 | bool VisitAttributedTypeLoc(AttributedTypeLoc TL) { |
| 40 | handleAttr(TL); |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | bool TraverseDecl(Decl *D) { |
| 45 | if (!D || D->isImplicit()) |
| 46 | return true; |
| 47 | |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 48 | SaveAndRestore<bool> Save(FullyMigratable, isMigratable(D)); |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 49 | |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 50 | if (ObjCPropertyDecl *PropD = dyn_cast<ObjCPropertyDecl>(D)) { |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 51 | lookForAttribute(PropD, PropD->getTypeSourceInfo()); |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 52 | AllProps.push_back(PropD); |
| 53 | } else if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)) { |
| 54 | lookForAttribute(DD, DD->getTypeSourceInfo()); |
| 55 | } |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 56 | return base::TraverseDecl(D); |
| 57 | } |
| 58 | |
| 59 | void lookForAttribute(Decl *D, TypeSourceInfo *TInfo) { |
| 60 | if (!TInfo) |
| 61 | return; |
| 62 | TypeLoc TL = TInfo->getTypeLoc(); |
| 63 | while (TL) { |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 64 | if (const QualifiedTypeLoc *QL = dyn_cast<QualifiedTypeLoc>(&TL)) { |
| 65 | TL = QL->getUnqualifiedLoc(); |
| 66 | } else if (const AttributedTypeLoc * |
| 67 | Attr = dyn_cast<AttributedTypeLoc>(&TL)) { |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 68 | if (handleAttr(*Attr, D)) |
| 69 | break; |
| 70 | TL = Attr->getModifiedLoc(); |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 71 | } else if (const ArrayTypeLoc *Arr = dyn_cast<ArrayTypeLoc>(&TL)) { |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 72 | TL = Arr->getElementLoc(); |
| 73 | } else if (const PointerTypeLoc *PT = dyn_cast<PointerTypeLoc>(&TL)) { |
| 74 | TL = PT->getPointeeLoc(); |
| 75 | } else if (const ReferenceTypeLoc *RT = dyn_cast<ReferenceTypeLoc>(&TL)) |
| 76 | TL = RT->getPointeeLoc(); |
| 77 | else |
| 78 | break; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | bool handleAttr(AttributedTypeLoc TL, Decl *D = 0) { |
| 83 | if (TL.getAttrKind() != AttributedType::attr_objc_ownership) |
| 84 | return false; |
| 85 | |
| 86 | SourceLocation Loc = TL.getAttrNameLoc(); |
| 87 | unsigned RawLoc = Loc.getRawEncoding(); |
| 88 | if (MigrateCtx.AttrSet.count(RawLoc)) |
| 89 | return true; |
| 90 | |
| 91 | ASTContext &Ctx = MigrateCtx.Pass.Ctx; |
| 92 | SourceManager &SM = Ctx.getSourceManager(); |
Argyrios Kyrtzidis | 12192cf | 2011-11-07 18:40:29 +0000 | [diff] [blame] | 93 | if (Loc.isMacroID()) |
| 94 | Loc = SM.getImmediateExpansionRange(Loc).first; |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 95 | llvm::SmallString<32> Buf; |
| 96 | bool Invalid = false; |
| 97 | StringRef Spell = Lexer::getSpelling( |
| 98 | SM.getSpellingLoc(TL.getAttrEnumOperandLoc()), |
| 99 | Buf, SM, Ctx.getLangOptions(), &Invalid); |
| 100 | if (Invalid) |
| 101 | return false; |
| 102 | MigrationContext::GCAttrOccurrence::AttrKind Kind; |
| 103 | if (Spell == "strong") |
| 104 | Kind = MigrationContext::GCAttrOccurrence::Strong; |
| 105 | else if (Spell == "weak") |
| 106 | Kind = MigrationContext::GCAttrOccurrence::Weak; |
| 107 | else |
| 108 | return false; |
| 109 | |
| 110 | MigrateCtx.AttrSet.insert(RawLoc); |
| 111 | MigrateCtx.GCAttrs.push_back(MigrationContext::GCAttrOccurrence()); |
| 112 | MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs.back(); |
| 113 | |
| 114 | Attr.Kind = Kind; |
Argyrios Kyrtzidis | 12192cf | 2011-11-07 18:40:29 +0000 | [diff] [blame] | 115 | Attr.Loc = Loc; |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 116 | Attr.ModifiedType = TL.getModifiedLoc().getType(); |
| 117 | Attr.Dcl = D; |
| 118 | Attr.FullyMigratable = FullyMigratable; |
| 119 | return true; |
| 120 | } |
| 121 | |
| 122 | bool isMigratable(Decl *D) { |
| 123 | if (isa<TranslationUnitDecl>(D)) |
| 124 | return false; |
| 125 | |
| 126 | if (isInMainFile(D)) |
| 127 | return true; |
| 128 | |
| 129 | if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) |
| 130 | return FD->hasBody(); |
| 131 | |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 132 | if (ObjCContainerDecl *ContD = dyn_cast<ObjCContainerDecl>(D)) |
| 133 | return hasObjCImpl(ContD); |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 134 | |
| 135 | if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) { |
| 136 | for (CXXRecordDecl::method_iterator |
| 137 | MI = RD->method_begin(), ME = RD->method_end(); MI != ME; ++MI) { |
| 138 | if ((*MI)->isOutOfLine()) |
| 139 | return true; |
| 140 | } |
| 141 | return false; |
| 142 | } |
| 143 | |
| 144 | return isMigratable(cast<Decl>(D->getDeclContext())); |
| 145 | } |
| 146 | |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 147 | static bool hasObjCImpl(Decl *D) { |
| 148 | if (!D) |
| 149 | return false; |
| 150 | if (ObjCContainerDecl *ContD = dyn_cast<ObjCContainerDecl>(D)) { |
| 151 | if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(ContD)) |
| 152 | return ID->getImplementation() != 0; |
| 153 | if (ObjCCategoryDecl *CD = dyn_cast<ObjCCategoryDecl>(ContD)) |
| 154 | return CD->getImplementation() != 0; |
| 155 | if (isa<ObjCImplDecl>(ContD)) |
| 156 | return true; |
| 157 | return false; |
| 158 | } |
| 159 | return false; |
| 160 | } |
| 161 | |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 162 | bool isInMainFile(Decl *D) { |
| 163 | if (!D) |
| 164 | return false; |
| 165 | |
| 166 | for (Decl::redecl_iterator |
| 167 | I = D->redecls_begin(), E = D->redecls_end(); I != E; ++I) |
| 168 | if (!isInMainFile((*I)->getLocation())) |
| 169 | return false; |
| 170 | |
| 171 | return true; |
| 172 | } |
| 173 | |
| 174 | bool isInMainFile(SourceLocation Loc) { |
| 175 | if (Loc.isInvalid()) |
| 176 | return false; |
| 177 | |
| 178 | SourceManager &SM = MigrateCtx.Pass.Ctx.getSourceManager(); |
| 179 | return SM.isInFileID(SM.getExpansionLoc(Loc), SM.getMainFileID()); |
| 180 | } |
| 181 | }; |
| 182 | |
| 183 | } // anonymous namespace |
| 184 | |
Argyrios Kyrtzidis | 17ac319 | 2011-11-06 18:58:17 +0000 | [diff] [blame] | 185 | static void clearRedundantStrongs(MigrationContext &MigrateCtx) { |
| 186 | TransformActions &TA = MigrateCtx.Pass.TA; |
| 187 | |
| 188 | for (unsigned i = 0, e = MigrateCtx.GCAttrs.size(); i != e; ++i) { |
| 189 | MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs[i]; |
| 190 | if (Attr.Kind == MigrationContext::GCAttrOccurrence::Strong && |
| 191 | Attr.FullyMigratable && Attr.Dcl) { |
| 192 | TypeSourceInfo *TInfo = 0; |
| 193 | if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(Attr.Dcl)) |
| 194 | TInfo = DD->getTypeSourceInfo(); |
| 195 | else if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(Attr.Dcl)) |
| 196 | TInfo = PD->getTypeSourceInfo(); |
| 197 | if (!TInfo) |
| 198 | continue; |
| 199 | |
| 200 | if (TInfo->getType().getObjCLifetime() == Qualifiers::OCL_Strong) { |
| 201 | Transaction Trans(TA); |
| 202 | TA.remove(Attr.Loc); |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
Argyrios Kyrtzidis | 280b4ad | 2011-11-06 18:58:23 +0000 | [diff] [blame] | 208 | static void errorForGCAttrsOnNonObjC(MigrationContext &MigrateCtx) { |
| 209 | TransformActions &TA = MigrateCtx.Pass.TA; |
| 210 | |
| 211 | for (unsigned i = 0, e = MigrateCtx.GCAttrs.size(); i != e; ++i) { |
| 212 | MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs[i]; |
| 213 | if (Attr.FullyMigratable && Attr.Dcl) { |
| 214 | if (Attr.ModifiedType.isNull()) |
| 215 | continue; |
| 216 | if (!Attr.ModifiedType->isObjCRetainableType()) { |
| 217 | TA.reportError("GC managed memory will become unmanaged in ARC", |
| 218 | Attr.Loc); |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
Argyrios Kyrtzidis | 12192cf | 2011-11-07 18:40:29 +0000 | [diff] [blame] | 224 | static void checkWeakGCAttrs(MigrationContext &MigrateCtx) { |
| 225 | TransformActions &TA = MigrateCtx.Pass.TA; |
| 226 | |
| 227 | for (unsigned i = 0, e = MigrateCtx.GCAttrs.size(); i != e; ++i) { |
| 228 | MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs[i]; |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 229 | if (Attr.Kind == MigrationContext::GCAttrOccurrence::Weak) { |
Argyrios Kyrtzidis | 12192cf | 2011-11-07 18:40:29 +0000 | [diff] [blame] | 230 | if (Attr.ModifiedType.isNull() || |
| 231 | !Attr.ModifiedType->isObjCRetainableType()) |
| 232 | continue; |
| 233 | if (!canApplyWeak(MigrateCtx.Pass.Ctx, Attr.ModifiedType, |
| 234 | /*AllowOnUnknownClass=*/true)) { |
| 235 | Transaction Trans(TA); |
| 236 | TA.replaceText(Attr.Loc, "__weak", "__unsafe_unretained"); |
| 237 | TA.clearDiagnostic(diag::err_arc_weak_no_runtime, |
| 238 | diag::err_arc_unsupported_weak_class, |
| 239 | Attr.Loc); |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 245 | typedef llvm::TinyPtrVector<ObjCPropertyDecl *> IndivPropsTy; |
| 246 | |
| 247 | static void checkAllAtProps(MigrationContext &MigrateCtx, |
| 248 | SourceLocation AtLoc, |
| 249 | IndivPropsTy &IndProps) { |
| 250 | if (IndProps.empty()) |
| 251 | return; |
| 252 | |
| 253 | for (IndivPropsTy::iterator |
| 254 | PI = IndProps.begin(), PE = IndProps.end(); PI != PE; ++PI) { |
| 255 | QualType T = (*PI)->getType(); |
| 256 | if (T.isNull() || !T->isObjCRetainableType()) |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | SmallVector<std::pair<AttributedTypeLoc, ObjCPropertyDecl *>, 4> ATLs; |
| 261 | bool hasWeak = false, hasStrong = false; |
| 262 | for (IndivPropsTy::iterator |
| 263 | PI = IndProps.begin(), PE = IndProps.end(); PI != PE; ++PI) { |
| 264 | ObjCPropertyDecl *PD = *PI; |
| 265 | TypeSourceInfo *TInfo = PD->getTypeSourceInfo(); |
| 266 | if (!TInfo) |
| 267 | return; |
| 268 | TypeLoc TL = TInfo->getTypeLoc(); |
| 269 | if (AttributedTypeLoc *ATL = dyn_cast<AttributedTypeLoc>(&TL)) { |
| 270 | ATLs.push_back(std::make_pair(*ATL, PD)); |
| 271 | if (TInfo->getType().getObjCLifetime() == Qualifiers::OCL_Weak) { |
| 272 | hasWeak = true; |
| 273 | } else if (TInfo->getType().getObjCLifetime() == Qualifiers::OCL_Strong) |
| 274 | hasStrong = true; |
| 275 | else |
| 276 | return; |
| 277 | } |
| 278 | } |
| 279 | if (ATLs.empty()) |
| 280 | return; |
| 281 | if (hasWeak && hasStrong) |
| 282 | return; |
| 283 | |
| 284 | TransformActions &TA = MigrateCtx.Pass.TA; |
| 285 | Transaction Trans(TA); |
| 286 | |
| 287 | if (GCAttrsCollector::hasObjCImpl( |
| 288 | cast<Decl>(IndProps.front()->getDeclContext()))) { |
| 289 | if (hasWeak) |
| 290 | MigrateCtx.AtPropsWeak.insert(AtLoc.getRawEncoding()); |
| 291 | |
| 292 | } else { |
| 293 | StringRef toAttr = "strong"; |
| 294 | if (hasWeak) { |
| 295 | if (canApplyWeak(MigrateCtx.Pass.Ctx, IndProps.front()->getType(), |
| 296 | /*AllowOnUnkwownClass=*/true)) |
| 297 | toAttr = "weak"; |
| 298 | else |
| 299 | toAttr = "unsafe_unretained"; |
| 300 | } |
| 301 | if (!MigrateCtx.rewritePropertyAttribute("assign", toAttr, AtLoc)) { |
| 302 | return; |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | for (unsigned i = 0, e = ATLs.size(); i != e; ++i) { |
| 307 | SourceLocation Loc = ATLs[i].first.getAttrNameLoc(); |
| 308 | if (Loc.isMacroID()) |
| 309 | Loc = MigrateCtx.Pass.Ctx.getSourceManager() |
| 310 | .getImmediateExpansionRange(Loc).first; |
| 311 | TA.remove(Loc); |
| 312 | TA.clearDiagnostic(diag::err_objc_property_attr_mutually_exclusive, AtLoc); |
| 313 | TA.clearDiagnostic(diag::err_arc_inconsistent_property_ownership, |
| 314 | ATLs[i].second->getLocation()); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | static void checkAllProps(MigrationContext &MigrateCtx, |
| 319 | std::vector<ObjCPropertyDecl *> &AllProps) { |
| 320 | typedef llvm::TinyPtrVector<ObjCPropertyDecl *> IndivPropsTy; |
| 321 | llvm::DenseMap<unsigned, IndivPropsTy> AtProps; |
| 322 | |
| 323 | for (unsigned i = 0, e = AllProps.size(); i != e; ++i) { |
| 324 | ObjCPropertyDecl *PD = AllProps[i]; |
| 325 | if (PD->getPropertyAttributesAsWritten() & |
| 326 | ObjCPropertyDecl::OBJC_PR_assign) { |
| 327 | SourceLocation AtLoc = PD->getAtLoc(); |
| 328 | if (AtLoc.isInvalid()) |
| 329 | continue; |
| 330 | unsigned RawAt = AtLoc.getRawEncoding(); |
| 331 | AtProps[RawAt].push_back(PD); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | for (llvm::DenseMap<unsigned, IndivPropsTy>::iterator |
| 336 | I = AtProps.begin(), E = AtProps.end(); I != E; ++I) { |
| 337 | SourceLocation AtLoc = SourceLocation::getFromRawEncoding(I->first); |
| 338 | IndivPropsTy &IndProps = I->second; |
| 339 | checkAllAtProps(MigrateCtx, AtLoc, IndProps); |
| 340 | } |
| 341 | } |
| 342 | |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 343 | void GCAttrsTraverser::traverseTU(MigrationContext &MigrateCtx) { |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 344 | std::vector<ObjCPropertyDecl *> AllProps; |
| 345 | GCAttrsCollector(MigrateCtx, AllProps).TraverseDecl( |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 346 | MigrateCtx.Pass.Ctx.getTranslationUnitDecl()); |
Argyrios Kyrtzidis | 280b4ad | 2011-11-06 18:58:23 +0000 | [diff] [blame] | 347 | |
Argyrios Kyrtzidis | 17ac319 | 2011-11-06 18:58:17 +0000 | [diff] [blame] | 348 | clearRedundantStrongs(MigrateCtx); |
Argyrios Kyrtzidis | 280b4ad | 2011-11-06 18:58:23 +0000 | [diff] [blame] | 349 | errorForGCAttrsOnNonObjC(MigrateCtx); |
Argyrios Kyrtzidis | 12192cf | 2011-11-07 18:40:29 +0000 | [diff] [blame] | 350 | checkWeakGCAttrs(MigrateCtx); |
Argyrios Kyrtzidis | b0e1e12 | 2011-11-07 18:46:46 +0000 | [diff] [blame] | 351 | checkAllProps(MigrateCtx, AllProps); |
Argyrios Kyrtzidis | 17ac319 | 2011-11-06 18:58:17 +0000 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | void MigrationContext::dumpGCAttrs() { |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 355 | llvm::errs() << "\n################\n"; |
Argyrios Kyrtzidis | 17ac319 | 2011-11-06 18:58:17 +0000 | [diff] [blame] | 356 | for (unsigned i = 0, e = GCAttrs.size(); i != e; ++i) { |
| 357 | GCAttrOccurrence &Attr = GCAttrs[i]; |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 358 | llvm::errs() << "KIND: " |
Argyrios Kyrtzidis | 17ac319 | 2011-11-06 18:58:17 +0000 | [diff] [blame] | 359 | << (Attr.Kind == GCAttrOccurrence::Strong ? "strong" : "weak"); |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 360 | llvm::errs() << "\nLOC: "; |
Argyrios Kyrtzidis | 17ac319 | 2011-11-06 18:58:17 +0000 | [diff] [blame] | 361 | Attr.Loc.dump(Pass.Ctx.getSourceManager()); |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 362 | llvm::errs() << "\nTYPE: "; |
| 363 | Attr.ModifiedType.dump(); |
| 364 | if (Attr.Dcl) { |
| 365 | llvm::errs() << "DECL:\n"; |
| 366 | Attr.Dcl->dump(); |
| 367 | } else { |
| 368 | llvm::errs() << "DECL: NONE"; |
| 369 | } |
| 370 | llvm::errs() << "\nMIGRATABLE: " << Attr.FullyMigratable; |
| 371 | llvm::errs() << "\n----------------\n"; |
| 372 | } |
| 373 | llvm::errs() << "\n################\n"; |
Argyrios Kyrtzidis | f38fa73 | 2011-11-06 18:58:03 +0000 | [diff] [blame] | 374 | } |