Skip to content

Commit 853ae2b

Browse files
committed
Drive-by cleanup of the shouldRegister methods
1 parent f4e583f commit 853ae2b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,17 @@ void ento::registerPureVirtualCallChecker(CheckerManager &Mgr) {
213213
Mgr.registerChecker<VirtualCallChecker, VirtualCallChecker::PureChecker>();
214214
}
215215

216+
bool ento::shouldRegisterPureVirtualCallChecker(const CheckerManager &Mgr) {
217+
return Mgr.getLangOpts().CPlusPlus;
218+
}
219+
216220
void ento::registerVirtualCallChecker(CheckerManager &Mgr) {
217221
auto *Chk = Mgr.registerChecker<VirtualCallChecker,
218222
VirtualCallChecker::ImpureChecker>();
219223
Chk->ShowFixIts = Mgr.getAnalyzerOptions().getCheckerBooleanOption(
220224
Mgr.getCurrentCheckerName(), "ShowFixIts");
221225
}
222226

223-
bool ento::shouldRegisterPureVirtualCallChecker(const CheckerManager &mgr) {
224-
const LangOptions &LO = mgr.getLangOpts();
225-
return LO.CPlusPlus;
226-
}
227-
228-
bool ento::shouldRegisterVirtualCallChecker(const CheckerManager &mgr) {
229-
const LangOptions &LO = mgr.getLangOpts();
230-
return LO.CPlusPlus;
227+
bool ento::shouldRegisterVirtualCallChecker(const CheckerManager &Mgr) {
228+
return Mgr.getLangOpts().CPlusPlus;
231229
}

0 commit comments

Comments
 (0)