bool ReplaceSimpleTypedefRewriteVisitor::VisitTypedefTypeLoc(TypedefTypeLoc Loc) { const TypedefType *TdefTy = Loc.getTypePtr(); const TypedefDecl *TdefD = dyn_cast<TypedefDecl>(TdefTy->getDecl()); if (!TdefD) return true; if (dyn_cast<TypedefDecl>(TdefD->getCanonicalDecl()) == ConsumerInstance->TheTypedefDecl) { SourceRange Range = Loc.getSourceRange(); ConsumerInstance->TheRewriter.ReplaceText(Range, ConsumerInstance->TyName); } return true; }
bool UnnecessaryIncludeFinder::VisitTypedefTypeLoc (TypedefTypeLoc typeLoc) { markUsed(typeLoc.getTypePtr()->getDecl()->getLocation(), typeLoc.getBeginLoc()); return true; }