mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:50:17 +08:00
[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.
This commit is contained in:
committed by
GitHub
parent
c7c6c0a45c
commit
7b6bf8b060
@@ -364,7 +364,7 @@ private:
|
||||
void storeTopLevelDecls(DeclGroupRef DG);
|
||||
|
||||
/// Check if we should skip (not analyze) the given function.
|
||||
AnalysisMode getModeForDecl(Decl *D, AnalysisMode Mode);
|
||||
AnalysisMode getModeForDecl(const Decl *D, AnalysisMode Mode);
|
||||
void runAnalysisOnTranslationUnit(ASTContext &C);
|
||||
|
||||
/// Print \p S to stderr if \c Opts.AnalyzerDisplayProgress is set.
|
||||
@@ -677,7 +677,7 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
|
||||
}
|
||||
|
||||
AnalysisConsumer::AnalysisMode
|
||||
AnalysisConsumer::getModeForDecl(Decl *D, AnalysisMode Mode) {
|
||||
AnalysisConsumer::getModeForDecl(const Decl *D, AnalysisMode Mode) {
|
||||
if (!Opts.AnalyzeSpecificFunction.empty() &&
|
||||
AnalysisDeclContext::getFunctionName(D) != Opts.AnalyzeSpecificFunction &&
|
||||
cross_tu::CrossTranslationUnitContext::getLookupName(D).value_or("") !=
|
||||
@@ -695,7 +695,7 @@ AnalysisConsumer::getModeForDecl(Decl *D, AnalysisMode Mode) {
|
||||
|
||||
const SourceManager &SM = Ctx->getSourceManager();
|
||||
|
||||
const SourceLocation Loc = [&SM](Decl *D) -> SourceLocation {
|
||||
const SourceLocation Loc = [&SM](const Decl *D) -> SourceLocation {
|
||||
const Stmt *Body = D->getBody();
|
||||
SourceLocation SL = Body ? Body->getBeginLoc() : D->getLocation();
|
||||
return SM.getExpansionLoc(SL);
|
||||
|
||||
Reference in New Issue
Block a user