Skip to content

Commit 7b6bf8b

Browse files
authored
[NFC][analyzer] const ptr param in AnalysisConsumer::getModeForDecl (#170145)
This is a tiny change that would make the function contract more clear and our work downstream easier.
1 parent c7c6c0a commit 7b6bf8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class AnalysisConsumer : public AnalysisASTConsumer,
364364
void storeTopLevelDecls(DeclGroupRef DG);
365365

366366
/// Check if we should skip (not analyze) the given function.
367-
AnalysisMode getModeForDecl(Decl *D, AnalysisMode Mode);
367+
AnalysisMode getModeForDecl(const Decl *D, AnalysisMode Mode);
368368
void runAnalysisOnTranslationUnit(ASTContext &C);
369369

370370
/// Print \p S to stderr if \c Opts.AnalyzerDisplayProgress is set.
@@ -677,7 +677,7 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
677677
}
678678

679679
AnalysisConsumer::AnalysisMode
680-
AnalysisConsumer::getModeForDecl(Decl *D, AnalysisMode Mode) {
680+
AnalysisConsumer::getModeForDecl(const Decl *D, AnalysisMode Mode) {
681681
if (!Opts.AnalyzeSpecificFunction.empty() &&
682682
AnalysisDeclContext::getFunctionName(D) != Opts.AnalyzeSpecificFunction &&
683683
cross_tu::CrossTranslationUnitContext::getLookupName(D).value_or("") !=
@@ -695,7 +695,7 @@ AnalysisConsumer::getModeForDecl(Decl *D, AnalysisMode Mode) {
695695

696696
const SourceManager &SM = Ctx->getSourceManager();
697697

698-
const SourceLocation Loc = [&SM](Decl *D) -> SourceLocation {
698+
const SourceLocation Loc = [&SM](const Decl *D) -> SourceLocation {
699699
const Stmt *Body = D->getBody();
700700
SourceLocation SL = Body ? Body->getBeginLoc() : D->getLocation();
701701
return SM.getExpansionLoc(SL);

0 commit comments

Comments
 (0)