diff options
Diffstat (limited to 'clang/lib/ARCMigrate')
-rw-r--r-- | clang/lib/ARCMigrate/ARCMT.cpp | 6 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/FileRemapper.cpp | 6 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/Internals.h | 2 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 144 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/PlistReporter.cpp | 2 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransARCAssign.cpp | 2 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransAutoreleasePool.cpp | 10 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransBlockObjCVariable.cpp | 6 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp | 2 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransGCAttrs.cpp | 6 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransProperties.cpp | 14 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransProtectedScope.cpp | 2 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp | 4 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransUnbridgedCasts.cpp | 4 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp | 14 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/TransformActions.cpp | 6 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/Transforms.cpp | 38 | ||||
-rw-r--r-- | clang/lib/ARCMigrate/Transforms.h | 2 |
18 files changed, 135 insertions, 135 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 74c9974cc81..3c7b593be6d 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -226,7 +226,7 @@ static void emitPremigrationErrors(const CapturedDiagList &arcDiags, new DiagnosticsEngine(DiagID, diagOpts, &printer, /*ShouldOwnClient=*/false)); Diags->setSourceManager(&PP.getSourceManager()); - + printer.BeginSourceFile(PP.getLangOpts(), &PP); arcDiags.reportDiagnostics(*Diags); printer.EndSourceFile(); @@ -305,7 +305,7 @@ bool arcmt::checkForManualIssues( // After parsing of source files ended, we want to reuse the // diagnostics objects to emit further diagnostics. - // We call BeginSourceFile because DiagnosticConsumer requires that + // We call BeginSourceFile because DiagnosticConsumer requires that // diagnostics with source range information are emitted only in between // BeginSourceFile() and EndSourceFile(). DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor()); @@ -572,7 +572,7 @@ bool MigrationProcess::applyTransform(TransformFn trans, // After parsing of source files ended, we want to reuse the // diagnostics objects to emit further diagnostics. - // We call BeginSourceFile because DiagnosticConsumer requires that + // We call BeginSourceFile because DiagnosticConsumer requires that // diagnostics with source range information are emitted only in between // BeginSourceFile() and EndSourceFile(). DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor()); diff --git a/clang/lib/ARCMigrate/FileRemapper.cpp b/clang/lib/ARCMigrate/FileRemapper.cpp index 4dedac88f98..ccc8c9ee30f 100644 --- a/clang/lib/ARCMigrate/FileRemapper.cpp +++ b/clang/lib/ARCMigrate/FileRemapper.cpp @@ -67,7 +67,7 @@ bool FileRemapper::initFromFile(StringRef filePath, DiagnosticsEngine &Diag, llvm::MemoryBuffer::getFile(infoFile); if (!fileBuf) return report("Error opening file: " + infoFile, Diag); - + SmallVector<StringRef, 64> lines; fileBuf.get()->getBuffer().split(lines, "\n"); @@ -78,7 +78,7 @@ bool FileRemapper::initFromFile(StringRef filePath, DiagnosticsEngine &Diag, return report("Invalid file data: '" + lines[idx+1] + "' not a number", Diag); StringRef toFilename = lines[idx+2]; - + const FileEntry *origFE = FileMgr->getFile(fromFilename); if (!origFE) { if (ignoreIfFilesChanged) @@ -152,7 +152,7 @@ bool FileRemapper::flushToFile(StringRef outputPath, DiagnosticsEngine &Diag) { llvm::MemoryBuffer *mem = I->second.get<llvm::MemoryBuffer *>(); newOut.write(mem->getBufferStart(), mem->getBufferSize()); newOut.close(); - + const FileEntry *newE = FileMgr->getFile(tempPath); remap(origFE, newE); infoOut << newE->getName() << '\n'; diff --git a/clang/lib/ARCMigrate/Internals.h b/clang/lib/ARCMigrate/Internals.h index 4f153b1ad2f..1a261c1e31a 100644 --- a/clang/lib/ARCMigrate/Internals.h +++ b/clang/lib/ARCMigrate/Internals.h @@ -25,7 +25,7 @@ namespace arcmt { class CapturedDiagList { typedef std::list<StoredDiagnostic> ListTy; ListTy List; - + public: void push_back(const StoredDiagnostic &diag) { List.push_back(diag); } diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 433e6194a2c..7e9bc6a5bdc 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -46,7 +46,7 @@ class ObjCMigrateASTConsumer : public ASTConsumer { CF_BRIDGING_ENABLE, CF_BRIDGING_MAY_INCLUDE }; - + void migrateDecl(Decl *D); void migrateObjCContainerDecl(ASTContext &Ctx, ObjCContainerDecl *D); void migrateProtocolConformance(ASTContext &Ctx, @@ -63,26 +63,26 @@ class ObjCMigrateASTConsumer : public ASTConsumer { void migrateFactoryMethod(ASTContext &Ctx, ObjCContainerDecl *CDecl, ObjCMethodDecl *OM, ObjCInstanceTypeFamily OIT_Family = OIT_None); - + void migrateCFAnnotation(ASTContext &Ctx, const Decl *Decl); void AddCFAnnotations(ASTContext &Ctx, const CallEffects &CE, const FunctionDecl *FuncDecl, bool ResultAnnotated); void AddCFAnnotations(ASTContext &Ctx, const CallEffects &CE, const ObjCMethodDecl *MethodDecl, bool ResultAnnotated); - + void AnnotateImplicitBridging(ASTContext &Ctx); - + CF_BRIDGING_KIND migrateAddFunctionAnnotation(ASTContext &Ctx, const FunctionDecl *FuncDecl); - + void migrateARCSafeAnnotation(ASTContext &Ctx, ObjCContainerDecl *CDecl); - + void migrateAddMethodAnnotation(ASTContext &Ctx, const ObjCMethodDecl *MethodDecl); void inferDesignatedInitializers(ASTContext &Ctx, const ObjCImplementationDecl *ImplD); - + bool InsertFoundation(ASTContext &Ctx, SourceLocation Loc); public: @@ -225,7 +225,7 @@ namespace { isa<ObjCIvarRefExpr>(Expr) || isa<ParenExpr>(FullExpr) || isa<ParenListExpr>(Expr) || isa<SizeOfPackExpr>(Expr)); } - + /// - Rewrite message expression for Objective-C setter and getters into /// property-dot syntax. bool rewriteToPropertyDotSyntax(const ObjCMessageExpr *Msg, @@ -239,17 +239,17 @@ namespace { if (const Expr *Receiver = Msg->getInstanceReceiver()) if (Receiver->getType()->isObjCBuiltinType()) return false; - + const ObjCMethodDecl *Method = Msg->getMethodDecl(); if (!Method) return false; if (!Method->isPropertyAccessor()) return false; - + const ObjCPropertyDecl *Prop = Method->findPropertyDecl(); if (!Prop) return false; - + SourceRange MsgRange = Msg->getSourceRange(); bool ReceiverIsSuper = (Msg->getReceiverKind() == ObjCMessageExpr::SuperInstance); @@ -276,7 +276,7 @@ namespace { PropertyDotString = "."; PropertyDotString += Prop->getName(); commit.replace(SpaceRange, PropertyDotString); - + // remove '[' ']' commit.replace(SourceRange(MsgRange.getBegin(), MsgRange.getBegin()), ""); commit.replace(SourceRange(MsgRange.getEnd(), MsgRange.getEnd()), ""); @@ -465,7 +465,7 @@ static void rewriteToObjCProperty(const ObjCMethodDecl *Getter, PropertyString += "(nonatomic"; LParenAdded = true; } - + std::string PropertyNameString = Getter->getNameAsString(); StringRef PropertyName(PropertyNameString); if (LengthOfPrefix > 0) { @@ -480,8 +480,8 @@ static void rewriteToObjCProperty(const ObjCMethodDecl *Getter, // Property with no setter may be suggested as a 'readonly' property. if (!Setter) append_attr(PropertyString, "readonly", LParenAdded); - - + + // Short circuit 'delegate' properties that contain the name "delegate" or // "dataSource", or have exact name "target" to have 'assign' attribute. if (PropertyName.equals("target") || @@ -542,7 +542,7 @@ static void rewriteToObjCProperty(const ObjCMethodDecl *Getter, } SourceLocation StartGetterSelectorLoc = Getter->getSelectorStartLoc(); Selector GetterSelector = Getter->getSelector(); - + SourceLocation EndGetterSelectorLoc = StartGetterSelectorLoc.getLocWithOffset(GetterSelector.getNameForSlot(0).size()); commit.replace(CharSourceRange::getCharRange(Getter->getLocStart(), @@ -572,7 +572,7 @@ void ObjCMigrateASTConsumer::migrateObjCContainerDecl(ASTContext &Ctx, ObjCContainerDecl *D) { if (D->isDeprecated() || IsCategoryNameWithDeprecatedSuffix(D)) return; - + for (auto *Method : D->methods()) { if (Method->isDeprecated()) continue; @@ -587,7 +587,7 @@ void ObjCMigrateASTConsumer::migrateObjCContainerDecl(ASTContext &Ctx, } if (!(ASTMigrateActions & FrontendOptions::ObjCMT_ReturnsInnerPointerProperty)) return; - + for (auto *Prop : D->instance_properties()) { if ((ASTMigrateActions & FrontendOptions::ObjCMT_Annotation) && !Prop->isDeprecated()) @@ -628,7 +628,7 @@ ClassImplementsAllMethodsAndProperties(ASTContext &Ctx, else return false; } - + // At this point, all required properties in this protocol conform to those // declared in the class. // Check that class implements the required methods of the protocol too. @@ -666,7 +666,7 @@ static bool rewriteToObjCInterfaceDecl(const ObjCInterfaceDecl *IDecl, std::string ClassString; SourceLocation EndLoc = IDecl->getSuperClass() ? IDecl->getSuperClassLoc() : IDecl->getLocation(); - + if (Protocols.empty()) { ClassString = '<'; for (unsigned i = 0, e = ConformingProtocols.size(); i != e; i++) { @@ -686,7 +686,7 @@ static bool rewriteToObjCInterfaceDecl(const ObjCInterfaceDecl *IDecl, ObjCInterfaceDecl::protocol_loc_iterator PL = IDecl->protocol_loc_end() - 1; EndLoc = *PL; } - + commit.insertAfterToken(EndLoc, ClassString); return true; } @@ -717,7 +717,7 @@ static bool rewriteToNSEnumDecl(const EnumDecl *EnumDcl, ClassString += NSIntegerName; } ClassString += ", "; - + ClassString += TypedefDcl->getIdentifier()->getName(); ClassString += ')'; SourceRange R(EnumDcl->getLocStart(), EnumDcl->getLocStart()); @@ -731,7 +731,7 @@ static bool rewriteToNSEnumDecl(const EnumDecl *EnumDcl, } else return false; - + SourceLocation EndTypedefDclLoc = TypedefDcl->getLocEnd(); EndTypedefDclLoc = trans::findSemiAfterLocation(EndTypedefDclLoc, NS.getASTContext(), /*IsDecl*/true); @@ -763,13 +763,13 @@ static void rewriteToNSMacroDecl(ASTContext &Ctx, QualType DesignatedEnumType = EnumDcl->getIntegerType(); assert(!DesignatedEnumType.isNull() && "rewriteToNSMacroDecl - underlying enum type is null"); - + PrintingPolicy Policy(Ctx.getPrintingPolicy()); std::string TypeString = DesignatedEnumType.getAsString(Policy); std::string ClassString = IsNSIntegerType ? "NS_ENUM(" : "NS_OPTIONS("; ClassString += TypeString; ClassString += ", "; - + ClassString += TypedefDcl->getIdentifier()->getName(); ClassString += ") "; SourceLocation EndLoc = EnumDcl->getBraceRange().getBegin(); @@ -781,7 +781,7 @@ static void rewriteToNSMacroDecl(ASTContext &Ctx, SourceLocation StartTypedefLoc = EnumDcl->getLocEnd(); StartTypedefLoc = StartTypedefLoc.getLocWithOffset(+1); SourceLocation EndTypedefLoc = TypedefDcl->getLocEnd(); - + commit.remove(SourceRange(StartTypedefLoc, EndTypedefLoc)); } @@ -801,7 +801,7 @@ static bool UseNSOptionsMacro(Preprocessor &PP, ASTContext &Ctx, if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(InitExpr)) if (BO->isShiftOp() || BO->isBitwiseOp()) return true; - + uint64_t EnumVal = Enumerator->getInitVal().getZExtValue(); if (PowerOfTwo && EnumVal) { if (!llvm::isPowerOf2_64(EnumVal)) @@ -826,7 +826,7 @@ static bool UseNSOptionsMacro(Preprocessor &PP, ASTContext &Ctx, return AllHexdecimalEnumerator || (PowerOfTwo && (MaxPowerOfTwoVal > 2)); } -void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx, +void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx, const ObjCImplementationDecl *ImpDecl) { const ObjCInterfaceDecl *IDecl = ImpDecl->getClassInterface(); if (!IDecl || ObjCProtocolDecls.empty() || IDecl->isDeprecated()) @@ -836,11 +836,11 @@ void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx, llvm::SmallPtrSet<ObjCProtocolDecl *, 8> ExplicitProtocols; Ctx.CollectInheritedProtocols(IDecl, ExplicitProtocols); llvm::SmallVector<ObjCProtocolDecl *, 8> PotentialImplicitProtocols; - + for (ObjCProtocolDecl *ProtDecl : ObjCProtocolDecls) if (!ExplicitProtocols.count(ProtDecl)) PotentialImplicitProtocols.push_back(ProtDecl); - + if (PotentialImplicitProtocols.empty()) return; @@ -852,10 +852,10 @@ void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx, if (ClassImplementsAllMethodsAndProperties(Ctx, ImpDecl, IDecl, PotentialImplicitProtocols[i])) ConformingProtocols.push_back(PotentialImplicitProtocols[i]); - + if (ConformingProtocols.empty()) return; - + // Further reduce number of conforming protocols. If protocol P1 is in the list // protocol P2 (P2<P1>), No need to include P1. llvm::SmallVector<ObjCProtocolDecl*, 8> MinimalConformingProtocols; @@ -885,7 +885,7 @@ void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx, void ObjCMigrateASTConsumer::CacheObjCNSIntegerTypedefed( const TypedefDecl *TypedefDcl) { - + QualType qt = TypedefDcl->getTypeSourceInfo()->getType(); if (NSAPIObj->isObjCNSIntegerType(qt)) NSIntegerTypedefed = TypedefDcl; @@ -919,10 +919,10 @@ bool ObjCMigrateASTConsumer::migrateNSEnumDecl(ASTContext &Ctx, } if (TypedefDcl->isDeprecated()) return false; - + QualType qt = TypedefDcl->getTypeSourceInfo()->getType(); StringRef NSIntegerName = NSAPIObj->GetNSIntegralKind(qt); - + if (NSIntegerName.empty()) { // Also check for typedef enum {...} TD; if (const EnumType *EnumTy = qt->getAs<EnumType>()) { @@ -938,7 +938,7 @@ bool ObjCMigrateASTConsumer::migrateNSEnumDecl(ASTContext &Ctx, } return false; } - + // We may still use NS_OPTIONS based on what we find in the enumertor list. bool NSOptions = UseNSOptionsMacro(PP, Ctx, EnumDcl); if (!InsertFoundation(Ctx, TypedefDcl->getLocStart())) @@ -1000,7 +1000,7 @@ void ObjCMigrateASTConsumer::migrateMethodInstanceType(ASTContext &Ctx, ObjCMethodDecl *OM) { ObjCInstanceTypeFamily OIT_Family = Selector::getInstTypeMethodFamily(OM->getSelector()); - + std::string ClassName; switch (OIT_Family) { case OIT_None: @@ -1025,7 +1025,7 @@ void ObjCMigrateASTConsumer::migrateMethodInstanceType(ASTContext &Ctx, } if (!OM->getReturnType()->isObjCIdType()) return; - + ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl); if (!IDecl) { if (ObjCCategoryDecl *CatDecl = dyn_cast<ObjCCategoryDecl>(CDecl)) @@ -1080,7 +1080,7 @@ static bool AvailabilityAttrsMatch(Attr *At1, Attr *At2) { if (!AA1) return true; const AvailabilityAttr *AA2 = dyn_cast<AvailabilityAttr>(At2); - + VersionTuple Introduced1 = AA1->getIntroduced(); VersionTuple Deprecated1 = AA1->getDeprecated(); VersionTuple Obsoleted1 = AA1->getObsoleted(); @@ -1159,14 +1159,14 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx, QualType GRT = Method->getReturnType(); if (GRT->isVoidType()) return false; - + Selector GetterSelector = Method->getSelector(); ObjCInstanceTypeFamily OIT_Family = Selector::getInstTypeMethodFamily(GetterSelector); - + if (OIT_Family != OIT_None) return false; - + IdentifierInfo *getterName = GetterSelector.getIdentifierInfoForSlot(0); Selector SetterSelector = SelectorTable::constructSetterSelector(PP.getIdentifierTable(), @@ -1199,7 +1199,7 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx, } } } - + if (SetterMethod) { if ((ASTMigrateActions & FrontendOptions::ObjCMT_ReadwriteProperty) == 0) return false; @@ -1207,7 +1207,7 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx, if (SetterMethod->isDeprecated() || !AttributesMatch(Method, SetterMethod, AvailabilityArgsMatch)) return false; - + // Is this a valid setter, matching the target getter? QualType SRT = SetterMethod->getReturnType(); if (!SRT->isVoidType()) @@ -1255,7 +1255,7 @@ void ObjCMigrateASTConsumer::migrateNsReturnsInnerPointer(ASTContext &Ctx, if (!TypeIsInnerPointer(RT) || !NSAPIObj->isMacroDefined("NS_RETURNS_INNER_POINTER")) return; - + edit::Commit commit(*Editor); commit.insertBefore(OM->getLocEnd(), " NS_RETURNS_INNER_POINTER"); Editor->commit(commit); @@ -1277,7 +1277,7 @@ void ObjCMigrateASTConsumer::migrateAllMethodInstaceType(ASTContext &Ctx, ObjCContainerDecl *CDecl) { if (CDecl->isDeprecated() || IsCategoryNameWithDeprecatedSuffix(CDecl)) return; - + // migrate methods which can have instancetype as their result type. for (auto *Method : CDecl->methods()) { if (Method->isDeprecated()) @@ -1294,7 +1294,7 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx, OM->getReturnType() == Ctx.getObjCInstanceType() || !OM->getReturnType()->isObjCIdType()) return; - + // Candidate factory methods are + (id) NaMeXXX : ... which belong to a class // NSYYYNamE with matching names be at least 3 characters long. ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl); @@ -1306,17 +1306,17 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx, } if (!IDecl) return; - + std::string StringClassName = IDecl->getName(); StringRef LoweredClassName(StringClassName); std::string StringLoweredClassName = LoweredClassName.lower(); LoweredClassName = StringLoweredClassName; - + IdentifierInfo *MethodIdName = OM->getSelector().getIdentifierInfoForSlot(0); // Handle method with no name at its first selector slot; e.g. + (id):(int)x. if (!MethodIdName) return; - + std::string MethodName = MethodIdName->getName(); if (OIT_Family == OIT_Singleton || OIT_Family == OIT_ReturnsSelf) { StringRef STRefMethodName(MethodName); @@ -1353,10 +1353,10 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx, static bool IsVoidStarType(QualType Ty) { if (!Ty->isPointerType()) return false; - + while (const TypedefType *TD = dyn_cast<TypedefType>(Ty.getTypePtr())) Ty = TD->getDecl()->getUnderlyingType(); - + // Is the type void*? const PointerType* PT = Ty->getAs<PointerType>(); if (PT->getPointeeType().getUnqualifiedType()->isVoidType()) @@ -1418,14 +1418,14 @@ void ObjCMigrateASTConsumer::AnnotateImplicitBridging(ASTContext &Ctx) { void ObjCMigrateASTConsumer::migrateCFAnnotation(ASTContext &Ctx, const Decl *Decl) { if (Decl->isDeprecated()) return; - + if (Decl->hasAttr<CFAuditedTransferAttr>()) { assert(CFFunctionIBCandidates.empty() && "Cannot have audited functions/methods inside user " "provided CF_IMPLICIT_BRIDGING_ENABLE"); return; } - + // Finction must be annotated first. if (const FunctionDecl *FuncDecl = dyn_cast<FunctionDecl>(Decl)) { CF_BRIDGING_KIND AuditKind = migrateAddFunctionAnnotation(Ctx, FuncDecl); @@ -1469,7 +1469,7 @@ void ObjCMigrateASTConsumer::AddCFAnnotations(ASTContext &Ctx, if (Ret.isOwned() && NSAPIObj->isMacroDefined("NS_RETURNS_RETAINED")) AnnotationString = " NS_RETURNS_RETAINED"; } - + if (AnnotationString) { edit::Commit commit(*Editor); commit.insertAfterToken(FuncDecl->getLocEnd(), AnnotationString); @@ -1503,18 +1503,18 @@ ObjCMigrateASTConsumer::CF_BRIDGING_KIND const FunctionDecl *FuncDecl) { if (FuncDecl->hasBody()) return CF_BRIDGING_NONE; - + CallEffects CE = CallEffects::getEffect(FuncDecl); bool FuncIsReturnAnnotated = (FuncDecl->hasAttr<CFReturnsRetainedAttr>() || FuncDecl->hasAttr<CFReturnsNotRetainedAttr>() || FuncDecl->hasAttr<NSReturnsRetainedAttr>() || FuncDecl->hasAttr<NSReturnsNotRetainedAttr>() || FuncDecl->hasAttr<NSReturnsAutoreleasedAttr>()); - + // Trivial case of when function is annotated and has no argument. if (FuncIsReturnAnnotated && FuncDecl->getNumParams() == 0) return CF_BRIDGING_NONE; - + bool ReturnCFAudited = false; if (!FuncIsReturnAnnotated) { RetEffect Ret = CE.getReturnValue(); @@ -1524,7 +1524,7 @@ ObjCMigrateASTConsumer::CF_BRIDGING_KIND else if (!AuditedType(FuncDecl->getReturnType())) return CF_BRIDGING_NONE; } - + // At this point result type is audited for potential inclusion. // Now, how about argument types. ArrayRef<ArgEffect> AEArgs = CE.getArgs(); @@ -1550,7 +1550,7 @@ ObjCMigrateASTConsumer::CF_BRIDGING_KIND } if (ReturnCFAudited || ArgCFAudited) return CF_BRIDGING_ENABLE; - + return CF_BRIDGING_MAY_INCLUDE; } @@ -1558,7 +1558,7 @@ void ObjCMigrateASTConsumer::migrateARCSafeAnnotation(ASTContext &Ctx, ObjCContainerDecl *CDecl) { if (!isa<ObjCInterfaceDecl>(CDecl) || CDecl->isDeprecated()) return; - + // migrate methods which can have instancetype as their result type. for (const auto *Method : CDecl->methods()) migrateCFAnnotation(Ctx, Method); @@ -1588,14 +1588,14 @@ void ObjCMigrateASTConsumer::AddCFAnnotations(ASTContext &Ctx, case clang::OMF_init: case clang::OMF_mutableCopy: break; - + default: if (Ret.isOwned() && NSAPIObj->isMacroDefined("NS_RETURNS_RETAINED")) AnnotationString = " NS_RETURNS_RETAINED"; break; } } - + if (AnnotationString) { edit::Commit commit(*Editor); commit.insertBefore(MethodDecl->getLocEnd(), AnnotationString); @@ -1622,7 +1622,7 @@ void ObjCMigrateASTConsumer::migrateAddMethodAnnotation( const ObjCMethodDecl *MethodDecl) { if (MethodDecl->hasBody() || MethodDecl->isImplicit()) return; - + CallEffects CE = CallEffects::getEffect(MethodDecl); bool MethodIsReturnAnnotated = (MethodDecl->hasAttr<CFReturnsRetainedAttr>() || MethodDecl->hasAttr<CFReturnsNotRetainedAttr>() || @@ -1639,12 +1639,12 @@ void ObjCMigrateASTConsumer::migrateAddMethodAnnotation( commit.insertBefore(MethodDecl->getLocEnd(), " NS_CONSUMES_SELF"); Editor->commit(commit); } - + // Trivial case of when function is annotated and has no argument. if (MethodIsReturnAnnotated && (MethodDecl->param_begin() == MethodDecl->param_end())) return; - + if (!MethodIsReturnAnnotated) { RetEffect Ret = CE.getReturnValue(); if ((Ret.getObjKind() == RetEffect::CF || @@ -1655,7 +1655,7 @@ void ObjCMigrateASTConsumer::migrateAddMethodAnnotation( } else if (!AuditedType(MethodDecl->getReturnType())) return; } - + // At this point result type is either annotated or audited. // Now, how about argument types. ArrayRef<ArgEffect> AEArgs = CE.getArgs(); @@ -1811,7 +1811,7 @@ private: OS.write_escaped(Text) << "\",\n"; } }; - + void insert(SourceLocation Loc, StringRef Text) override { EntryWriter Writer(SourceMgr, OS); Writer.writeLoc(Loc); @@ -1835,7 +1835,7 @@ private: } // end anonymous namespace void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { - + TranslationUnitDecl *TU = Ctx.getTranslationUnitDecl(); if (ASTMigrateActions & FrontendOptions::ObjCMT_MigrateDecls) { for (DeclContext::decl_iterator D = TU->decls_begin(), DEnd = TU->decls_end(); @@ -1846,7 +1846,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { if (ASTMigrateActions & FrontendOptions::ObjCMT_Annotation) AnnotateImplicitBridging(Ctx); } - + if (ObjCInterfaceDecl *CDecl = dyn_cast<ObjCInterfaceDecl>(*D)) if (canModify(CDecl)) migrateObjCContainerDecl(Ctx, CDecl); @@ -1911,7 +1911,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { canModify(FD)) migrateCFAnnotation(Ctx, FD); } - + if (ObjCContainerDecl *CDecl = dyn_cast<ObjCContainerDecl>(*D)) { bool CanModify = canModify(CDecl); // migrate methods which can have instancetype as their result type. @@ -1934,7 +1934,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { if (ASTMigrateActions & FrontendOptions::ObjCMT_Annotation) AnnotateImplicitBridging(Ctx); } - + if (IsOutputFile) { std::error_code EC; llvm::raw_fd_ostream OS(MigrateDir, EC, llvm::sys::fs::F_None); diff --git a/clang/lib/ARCMigrate/PlistReporter.cpp b/clang/lib/ARCMigrate/PlistReporter.cpp index 2ad1c8591a9..9e4cb3f4cd8 100644 --- a/clang/lib/ARCMigrate/PlistReporter.cpp +++ b/clang/lib/ARCMigrate/PlistReporter.cpp @@ -81,7 +81,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath, for (ArrayRef<StoredDiagnostic>::iterator DI = diags.begin(), DE = diags.end(); DI != DE; ++DI) { - + const StoredDiagnostic &D = *DI; if (D.getLevel() == DiagnosticsEngine::Ignored) diff --git a/clang/lib/ARCMigrate/TransARCAssign.cpp b/clang/lib/ARCMigrate/TransARCAssign.cpp index 80bfd22d625..d2b4de4891c 100644 --- a/clang/lib/ARCMigrate/TransARCAssign.cpp +++ b/clang/lib/ARCMigrate/TransARCAssign.cpp @@ -65,7 +65,7 @@ public: } } } - + return true; } }; diff --git a/clang/lib/ARCMigrate/TransAutoreleasePool.cpp b/clang/lib/ARCMigrate/TransAutoreleasePool.cpp index a8a99fa712a..2d35655d186 100644 --- a/clang/lib/ARCMigrate/TransAutoreleasePool.cpp +++ b/clang/lib/ARCMigrate/TransAutoreleasePool.cpp @@ -80,7 +80,7 @@ public: Body = body; TraverseStmt(body); } - + ~AutoreleasePoolRewriter() { SmallVector<VarDecl *, 8> VarsToHandle; @@ -174,7 +174,7 @@ public: PoolVarInfo &info = PoolVars[VD]; info.Dcl = DclS; collectRefs(VD, S, info.Refs); - // Does this statement follow the pattern: + // Does this statement follow the pattern: // NSAutoreleasePool * pool = [NSAutoreleasePool new]; if (isPoolCreation(VD->getInit())) { Scopes.push_back(PoolScope()); @@ -188,7 +188,7 @@ public: } else if (BinaryOperator *bop = dyn_cast<BinaryOperator>(child)) { if (DeclRefExpr *dref = dyn_cast<DeclRefExpr>(bop->getLHS())) { if (VarDecl *VD = dyn_cast<VarDecl>(dref->getDecl())) { - // Does this statement follow the pattern: + // Does this statement follow the pattern: // pool = [NSAutoreleasePool new]; if (isNSAutoreleasePool(VD->getType()) && isPoolCreation(bop->getRHS())) { @@ -311,7 +311,7 @@ private: scope.IsFollowedBySimpleReturnStmt = true; ++SI; // the return will be included in scope, don't check it. } - + for (; SI != SE; ++SI) { nameUsedOutsideScope = !NameReferenceChecker(Pass.Ctx, scope, referenceLoc, @@ -415,7 +415,7 @@ private: IdentifierInfo *PoolII; Selector DrainSel; - + struct PoolVarInfo { DeclStmt *Dcl; ExprSet Refs; diff --git a/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp b/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp index fac6a84c45e..85bdabb5046 100644 --- a/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp +++ b/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp @@ -43,11 +43,11 @@ class RootBlockObjCVarRewriter : class BlockVarChecker : public RecursiveASTVisitor<BlockVarChecker> { VarDecl *Var; - + typedef RecursiveASTVisitor<BlockVarChecker> base; public: BlockVarChecker(VarDecl *var) : Var(var) { } - + bool TraverseImplicitCastExpr(ImplicitCastExpr *castE) { if (DeclRefExpr * ref = dyn_cast<DeclRefExpr>(castE->getSubExpr())) { @@ -77,7 +77,7 @@ public: bool VisitBlockDecl(BlockDecl *block) { SmallVector<VarDecl *, 4> BlockVars; - + for (const auto &I : block->captures()) { VarDecl *var = I.getVariable(); if (I.isByRef() && diff --git a/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp b/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp index cbc22ed6017..0327b0def1e 100644 --- a/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp +++ b/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp @@ -208,7 +208,7 @@ static void cleanupDeallocOrFinalize(MigrationPass &pass) { for (auto *MD : I->instance_methods()) { if (!MD->hasBody()) continue; - + if (MD->getMethodFamily() == OMF_dealloc) { DeallocM = MD; } else if (MD->isInstanceMethod() && MD->getSelector() == FinalizeSel) { diff --git a/clang/lib/ARCMigrate/TransGCAttrs.cpp b/clang/lib/ARCMigrate/TransGCAttrs.cpp index 4fd21aa6c26..fb45cd92c1f 100644 --- a/clang/lib/ARCMigrate/TransGCAttrs.cpp +++ b/clang/lib/ARCMigrate/TransGCAttrs.cpp @@ -48,7 +48,7 @@ public: return true; SaveAndRestore<bool> Save(FullyMigratable, isMigratable(D)); - + if (ObjCPropertyDecl *PropD = dyn_cast<ObjCPropertyDecl>(D)) { lookForAttribute(PropD, PropD->getTypeSourceInfo()); AllProps.push_back(PropD); @@ -107,7 +107,7 @@ public: Kind = MigrationContext::GCAttrOccurrence::Weak; else return false; - + MigrateCtx.AttrSet.insert(RawLoc); MigrateCtx.GCAttrs.push_back(MigrationContext::GCAttrOccurrence()); MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs.back(); @@ -164,7 +164,7 @@ public: for (auto I : D->redecls()) if (!isInMainFile(I->getLocation())) return false; - + return true; } diff --git a/clang/lib/ARCMigrate/TransProperties.cpp b/clang/lib/ARCMigrate/TransProperties.cpp index 1468c21a009..912f77aeb78 100644 --- a/clang/lib/ARCMigrate/TransProperties.cpp +++ b/clang/lib/ARCMigrate/TransProperties.cpp @@ -47,7 +47,7 @@ class PropertiesRewriter { MigrationContext &MigrateCtx; MigrationPass &Pass; ObjCImplementationDecl *CurImplD; - + enum PropActionKind { PropAction_None, PropAction_RetainReplacedWithStrong, @@ -118,7 +118,7 @@ public: AtPropDeclsTy::iterator findAtLoc = AtProps.find(rawAtLoc); if (findAtLoc == AtProps.end()) continue; - + PropsTy &props = findAtLoc->second; for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) { if (I->PropD == propD) { @@ -137,7 +137,7 @@ public: continue; if (hasIvarWithExplicitARCOwnership(props)) continue; - + Transaction Trans(Pass.TA); rewriteProperty(props, atLoc); } @@ -170,7 +170,7 @@ private: void rewriteProperty(PropsTy &props, SourceLocation atLoc) { ObjCPropertyDecl::PropertyAttributeKind propAttrs = getPropertyAttrs(props); - + if (propAttrs & (ObjCPropertyDecl::OBJC_PR_copy | ObjCPropertyDecl::OBJC_PR_unsafe_unretained | ObjCPropertyDecl::OBJC_PR_strong | @@ -215,7 +215,7 @@ private: void rewriteAssign(PropsTy &props, SourceLocation atLoc) const { bool canUseWeak = canApplyWeak(Pass.Ctx, getPropertyType(props), /*AllowOnUnknownClass=*/Pass.isGCMigration()); - const char *toWhich = + const char *toWhich = (Pass.isGCMigration() && !hasGCWeak(props, atLoc)) ? "strong" : (canUseWeak ? "weak" : "unsafe_unretained"); @@ -227,7 +227,7 @@ private: if (isUserDeclared(I->IvarD)) { if (I->IvarD && I->IvarD->getType().getObjCLifetime() != Qualifiers::OCL_Weak) { - const char *toWhich = + const char *toWhich = (Pass.isGCMigration() && !hasGCWeak(props, atLoc)) ? "__strong " : (canUseWeak ? "__weak " : "__unsafe_unretained "); Pass.TA.insert(I->IvarD->getLocation(), toWhich); @@ -327,7 +327,7 @@ private: } } - return false; + return false; } // Returns true if all declarations in the @property have GC __weak. diff --git a/clang/lib/ARCMigrate/TransProtectedScope.cpp b/clang/lib/ARCMigrate/TransProtectedScope.cpp index 0fcbcbedfe0..1bb4c1f4e44 100644 --- a/clang/lib/ARCMigrate/TransProtectedScope.cpp +++ b/clang/lib/ARCMigrate/TransProtectedScope.cpp @@ -46,7 +46,7 @@ struct CaseInfo { St_CannotFix, St_Fixed } State; - + CaseInfo() : SC(nullptr), State(St_Unchecked) {} CaseInfo(SwitchCase *S, SourceRange Range) : SC(S), Range(Range), State(St_Unchecked) {} diff --git a/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index ebe289b34df..c411044ecde 100644 --- a/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -251,7 +251,7 @@ private: while (OuterS && (isa<ParenExpr>(OuterS) || isa<CastExpr>(OuterS) || isa<ExprWithCleanups>(OuterS))); - + if (!OuterS) return std::make_pair(prevStmt, nextStmt); @@ -419,7 +419,7 @@ private: bool isRemovable(Expr *E) const { return Removables.count(E); } - + bool tryRemoving(Expr *E) const { if (isRemovable(E)) { Pass.TA.removeStmt(E); diff --git a/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp b/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp index de52bef4d20..66167d37ac9 100644 --- a/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp +++ b/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp @@ -97,7 +97,7 @@ public: if (castType->isObjCRetainableType() == castExprType->isObjCRetainableType()) return true; - + bool exprRetainable = castExprType->isObjCIndirectLifetimeType(); bool castRetainable = castType->isObjCIndirectLifetimeType(); if (exprRetainable == castRetainable) return true; @@ -153,7 +153,7 @@ private: // Do not migrate to couple of bridge transfer casts which // cancel each other out. Leave it unchanged so error gets user // attention instead. - if (FD->getName() == "CFRetain" && + if (FD->getName() == "CFRetain" && FD->getNumParams() == 1 && FD->getParent()->isTranslationUnit() && FD->isExternallyVisible()) { diff --git a/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp b/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp index 76ce0ec90db..220102ec49c 100644 --- a/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp +++ b/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp @@ -56,7 +56,7 @@ public: bool BackedBySynthesizeSetter = false; for (llvm::DenseMap<ObjCPropertyDecl*, ObjCPropertyImplDecl*>::iterator - P = SynthesizedProperties.begin(), + P = SynthesizedProperties.begin(), E = SynthesizedProperties.end(); P != E; ++P) { ObjCPropertyDecl *PropDecl = P->first; if (PropDecl->getSetterName() == ME->getSelector()) { @@ -66,11 +66,11 @@ public: } if (!BackedBySynthesizeSetter) return true; - + // Remove the setter message if RHS is null Transaction Trans(TA); Expr *RHS = ME->getArg(0); - bool RHSIsNull = + bool RHSIsNull = RHS->isNullPointerConstant(Ctx, Expr::NPC_ValueDependentIsNull); if (RHSIsNull && isRemovable(ME)) @@ -119,10 +119,10 @@ public: ObjCPropertyDecl *PD = PID->getPropertyDecl(); ObjCMethodDecl *setterM = PD->getSetterMethodDecl(); if (!(setterM && setterM->isDefined())) { - ObjCPropertyDecl::PropertyAttributeKind AttrKind = + ObjCPropertyDecl::PropertyAttributeKind AttrKind = PD->getPropertyAttributes(); - if (AttrKind & - (ObjCPropertyDecl::OBJC_PR_retain | + if (AttrKind & + (ObjCPropertyDecl::OBJC_PR_retain | ObjCPropertyDecl::OBJC_PR_copy | ObjCPropertyDecl::OBJC_PR_strong)) SynthesizedProperties[PD] = PID; @@ -173,7 +173,7 @@ private: return false; bool IvarBacksPropertySynthesis = false; for (llvm::DenseMap<ObjCPropertyDecl*, ObjCPropertyImplDecl*>::iterator - P = SynthesizedProperties.begin(), + P = SynthesizedProperties.begin(), E = SynthesizedProperties.end(); P != E; ++P) { ObjCPropertyImplDecl *PropImpDecl = P->second; if (PropImpDecl && PropImpDecl->getPropertyIvarDecl() == IVDecl) { diff --git a/clang/lib/ARCMigrate/TransformActions.cpp b/clang/lib/ARCMigrate/TransformActions.cpp index 704be4374d3..3f79cc441e8 100644 --- a/clang/lib/ARCMigrate/TransformActions.cpp +++ b/clang/lib/ARCMigrate/TransformActions.cpp @@ -76,7 +76,7 @@ class TransformActionsImpl { End = FullSourceLoc(srcMgr.getExpansionLoc(endLoc), srcMgr); } assert(Begin.isValid() && End.isValid()); - } + } RangeComparison compareWith(const CharRange &RHS) const { if (End.isBeforeInTranslationUnitThan(RHS.Begin)) @@ -94,7 +94,7 @@ class TransformActionsImpl { else return Range_ExtendsEnd; } - + static RangeComparison compare(SourceRange LHS, SourceRange RHS, SourceManager &SrcMgr, Preprocessor &PP) { return CharRange(CharSourceRange::getTokenRange(LHS), SrcMgr, PP) @@ -485,7 +485,7 @@ void TransformActionsImpl::commitReplaceText(SourceLocation loc, SourceLocation afterText = loc.getLocWithOffset(text.size()); addRemoval(CharSourceRange::getCharRange(loc, afterText)); - commitInsert(loc, replacementText); + commitInsert(loc, replacementText); } void TransformActionsImpl::commitIncreaseIndentation(SourceRange range, diff --git a/clang/lib/ARCMigrate/Transforms.cpp b/clang/lib/ARCMigrate/Transforms.cpp index 1f4e6a297fc..4a7af285887 100644 --- a/clang/lib/ARCMigrate/Transforms.cpp +++ b/clang/lib/ARCMigrate/Transforms.cpp @@ -203,7 +203,7 @@ bool trans::isGlobalVar(Expr *E) { return isGlobalVar(condOp->getTrueExpr()) && isGlobalVar(condOp->getFalseExpr()); - return false; + return false; } StringRef trans::getNilString(MigrationPass &Pass) { @@ -240,9 +240,9 @@ class RemovablesCollector : public RecursiveASTVisitor<RemovablesCollector> { public: RemovablesCollector(ExprSet &removables) : Removables(removables) { } - + bool shouldWalkTypesOfTypeLocs() const { return false; } - + bool TraverseStmtExpr(StmtExpr *E) { CompoundStmt *S = E->getSubStmt(); for (CompoundStmt::body_iterator @@ -253,40 +253,40 @@ public: } return true; } - + bool VisitCompoundStmt(CompoundStmt *S) { for (auto *I : S->body()) mark(I); return true; } - + bool VisitIfStmt(IfStmt *S) { mark(S->getThen()); mark(S->getElse()); return true; } - + bool VisitWhileStmt(WhileStmt *S) { mark(S->getBody()); return true; } - + bool VisitDoStmt(DoStmt *S) { mark(S->getBody()); return true; } - + bool VisitForStmt(ForStmt *S) { mark(S->getInit()); mark(S->getInc()); mark(S->getBody()); return true; } - + private: void mark(Stmt *S) { if (!S) return; - + while (LabelStmt *Label = dyn_cast<LabelStmt>(S)) S = Label->getSubStmt(); S = S->IgnoreImplicit(); @@ -408,12 +408,12 @@ bool MigrationContext::rewritePropertyAttribute(StringRef fromAttr, return false; lexer.LexFromRawLexer(tok); if (tok.isNot(tok::l_paren)) return false; - + Token BeforeTok = tok; Token AfterTok; AfterTok.startToken(); SourceLocation AttrLoc; - + lexer.LexFromRawLexer(tok); if (tok.is(tok::r_paren)) return false; @@ -454,7 +454,7 @@ bool MigrationContext::rewritePropertyAttribute(StringRef fromAttr, return true; } - + return false; } @@ -493,7 +493,7 @@ bool MigrationContext::addPropertyAttribute(StringRef attr, Pass.TA.insert(tok.getLocation(), std::string("(") + attr.str() + ") "); return true; } - + lexer.LexFromRawLexer(tok); if (tok.is(tok::r_paren)) { Pass.TA.insert(tok.getLocation(), attr); @@ -520,7 +520,7 @@ static void GCRewriteFinalize(MigrationPass &pass) { DeclContext *DC = Ctx.getTranslationUnitDecl(); Selector FinalizeSel = Ctx.Selectors.getNullarySelector(&pass.Ctx.Idents.get("finalize")); - + typedef DeclContext::specific_decl_iterator<ObjCImplementationDecl> impl_iterator; for (impl_iterator I = impl_iterator(DC->decls_begin()), @@ -528,11 +528,11 @@ static void GCRewriteFinalize(MigrationPass &pass) { for (const auto *MD : I->instance_methods()) { if (!MD->hasBody()) continue; - + if (MD->isInstanceMethod() && MD->getSelector() == FinalizeSel) { const ObjCMethodDecl *FinalizeM = MD; Transaction Trans(TA); - TA.insert(FinalizeM->getSourceRange().getBegin(), + TA.insert(FinalizeM->getSourceRange().getBegin(), "#if !__has_feature(objc_arc)\n"); CharSourceRange::getTokenRange(FinalizeM->getSourceRange()); const SourceManager &SM = pass.Ctx.getSourceManager(); @@ -540,10 +540,10 @@ static void GCRewriteFinalize(MigrationPass &pass) { bool Invalid; std::string str = "\n#endif\n"; str += Lexer::getSourceText( - CharSourceRange::getTokenRange(FinalizeM->getSourceRange()), + CharSourceRange::getTokenRange(FinalizeM->getSourceRange()), SM, LangOpts, &Invalid); TA.insertAfterToken(FinalizeM->getSourceRange().getEnd(), str); - + break; } } diff --git a/clang/lib/ARCMigrate/Transforms.h b/clang/lib/ARCMigrate/Transforms.h index 8ea4f79456a..bafe9fc52a2 100644 --- a/clang/lib/ARCMigrate/Transforms.h +++ b/clang/lib/ARCMigrate/Transforms.h @@ -103,7 +103,7 @@ public: explicit MigrationContext(MigrationPass &pass) : Pass(pass) {} ~MigrationContext(); - + typedef std::vector<ASTTraverser *>::iterator traverser_iterator; traverser_iterator traversers_begin() { return Traversers.begin(); } traverser_iterator traversers_end() { return Traversers.end(); } |