[include-cleaner] NFC, use const HeaderSearch when possible.
This commit is contained in:
parent
e506bfa7ae
commit
7de541235f
@ -67,7 +67,7 @@ struct AnalysisResults {
|
|||||||
AnalysisResults analyze(llvm::ArrayRef<Decl *> ASTRoots,
|
AnalysisResults analyze(llvm::ArrayRef<Decl *> ASTRoots,
|
||||||
llvm::ArrayRef<SymbolReference> MacroRefs,
|
llvm::ArrayRef<SymbolReference> MacroRefs,
|
||||||
const Includes &I, const PragmaIncludes *PI,
|
const Includes &I, const PragmaIncludes *PI,
|
||||||
const SourceManager &SM, HeaderSearch &HS);
|
const SourceManager &SM, const HeaderSearch &HS);
|
||||||
|
|
||||||
/// Removes unused includes and inserts missing ones in the main file.
|
/// Removes unused includes and inserts missing ones in the main file.
|
||||||
/// Returns the modified main-file code.
|
/// Returns the modified main-file code.
|
||||||
@ -75,7 +75,7 @@ AnalysisResults analyze(llvm::ArrayRef<Decl *> ASTRoots,
|
|||||||
std::string fixIncludes(const AnalysisResults &Results, llvm::StringRef Code,
|
std::string fixIncludes(const AnalysisResults &Results, llvm::StringRef Code,
|
||||||
const format::FormatStyle &IncludeStyle);
|
const format::FormatStyle &IncludeStyle);
|
||||||
|
|
||||||
std::string spellHeader(const Header &H, HeaderSearch &HS,
|
std::string spellHeader(const Header &H, const HeaderSearch &HS,
|
||||||
const FileEntry *Main);
|
const FileEntry *Main);
|
||||||
|
|
||||||
/// Gets all the providers for a symbol by traversing each location.
|
/// Gets all the providers for a symbol by traversing each location.
|
||||||
|
@ -53,7 +53,7 @@ void walkUsed(llvm::ArrayRef<Decl *> ASTRoots,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string spellHeader(const Header &H, HeaderSearch &HS,
|
std::string spellHeader(const Header &H, const HeaderSearch &HS,
|
||||||
const FileEntry *Main) {
|
const FileEntry *Main) {
|
||||||
switch (H.kind()) {
|
switch (H.kind()) {
|
||||||
case Header::Physical: {
|
case Header::Physical: {
|
||||||
@ -73,7 +73,7 @@ std::string spellHeader(const Header &H, HeaderSearch &HS,
|
|||||||
AnalysisResults analyze(llvm::ArrayRef<Decl *> ASTRoots,
|
AnalysisResults analyze(llvm::ArrayRef<Decl *> ASTRoots,
|
||||||
llvm::ArrayRef<SymbolReference> MacroRefs,
|
llvm::ArrayRef<SymbolReference> MacroRefs,
|
||||||
const Includes &Inc, const PragmaIncludes *PI,
|
const Includes &Inc, const PragmaIncludes *PI,
|
||||||
const SourceManager &SM, HeaderSearch &HS) {
|
const SourceManager &SM, const HeaderSearch &HS) {
|
||||||
const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID());
|
const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID());
|
||||||
llvm::DenseSet<const Include *> Used;
|
llvm::DenseSet<const Include *> Used;
|
||||||
llvm::StringSet<> Missing;
|
llvm::StringSet<> Missing;
|
||||||
|
@ -63,7 +63,7 @@ std::vector<Hinted<SymbolLocation>> locateSymbol(const Symbol &S);
|
|||||||
void writeHTMLReport(FileID File, const Includes &,
|
void writeHTMLReport(FileID File, const Includes &,
|
||||||
llvm::ArrayRef<Decl *> Roots,
|
llvm::ArrayRef<Decl *> Roots,
|
||||||
llvm::ArrayRef<SymbolReference> MacroRefs, ASTContext &Ctx,
|
llvm::ArrayRef<SymbolReference> MacroRefs, ASTContext &Ctx,
|
||||||
HeaderSearch &HS, PragmaIncludes *PI,
|
const HeaderSearch &HS, PragmaIncludes *PI,
|
||||||
llvm::raw_ostream &OS);
|
llvm::raw_ostream &OS);
|
||||||
|
|
||||||
} // namespace include_cleaner
|
} // namespace include_cleaner
|
||||||
|
@ -134,7 +134,7 @@ class Reporter {
|
|||||||
llvm::raw_ostream &OS;
|
llvm::raw_ostream &OS;
|
||||||
const ASTContext &Ctx;
|
const ASTContext &Ctx;
|
||||||
const SourceManager &SM;
|
const SourceManager &SM;
|
||||||
HeaderSearch &HS;
|
const HeaderSearch &HS;
|
||||||
const include_cleaner::Includes &Includes;
|
const include_cleaner::Includes &Includes;
|
||||||
const PragmaIncludes *PI;
|
const PragmaIncludes *PI;
|
||||||
FileID MainFile;
|
FileID MainFile;
|
||||||
@ -208,7 +208,7 @@ class Reporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Reporter(llvm::raw_ostream &OS, ASTContext &Ctx, HeaderSearch &HS,
|
Reporter(llvm::raw_ostream &OS, ASTContext &Ctx, const HeaderSearch &HS,
|
||||||
const include_cleaner::Includes &Includes, const PragmaIncludes *PI,
|
const include_cleaner::Includes &Includes, const PragmaIncludes *PI,
|
||||||
FileID MainFile)
|
FileID MainFile)
|
||||||
: OS(OS), Ctx(Ctx), SM(Ctx.getSourceManager()), HS(HS),
|
: OS(OS), Ctx(Ctx), SM(Ctx.getSourceManager()), HS(HS),
|
||||||
@ -513,7 +513,7 @@ private:
|
|||||||
void writeHTMLReport(FileID File, const include_cleaner::Includes &Includes,
|
void writeHTMLReport(FileID File, const include_cleaner::Includes &Includes,
|
||||||
llvm::ArrayRef<Decl *> Roots,
|
llvm::ArrayRef<Decl *> Roots,
|
||||||
llvm::ArrayRef<SymbolReference> MacroRefs, ASTContext &Ctx,
|
llvm::ArrayRef<SymbolReference> MacroRefs, ASTContext &Ctx,
|
||||||
HeaderSearch &HS, PragmaIncludes *PI,
|
const HeaderSearch &HS, PragmaIncludes *PI,
|
||||||
llvm::raw_ostream &OS) {
|
llvm::raw_ostream &OS) {
|
||||||
Reporter R(OS, Ctx, HS, Includes, PI, File);
|
Reporter R(OS, Ctx, HS, Includes, PI, File);
|
||||||
const auto& SM = Ctx.getSourceManager();
|
const auto& SM = Ctx.getSourceManager();
|
||||||
|
@ -305,7 +305,7 @@ private:
|
|||||||
|
|
||||||
bool InMainFile = false;
|
bool InMainFile = false;
|
||||||
const SourceManager &SM;
|
const SourceManager &SM;
|
||||||
HeaderSearch &HeaderInfo;
|
const HeaderSearch &HeaderInfo;
|
||||||
PragmaIncludes *Out;
|
PragmaIncludes *Out;
|
||||||
llvm::BumpPtrAllocator Arena;
|
llvm::BumpPtrAllocator Arena;
|
||||||
/// Intern table for strings. Contents are on the arena.
|
/// Intern table for strings. Contents are on the arena.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user