@@ -202,7 +202,11 @@ namespace {
202202#else
203203 void checkEndFunction (CheckerContext &Ctx) const ;
204204#endif
205+ #if LLVM_VERSION_MAJOR >= 9
206+ bool evalCall (const CallEvent &Call, CheckerContext &C) const ;
207+ #else
205208 bool evalCall (const CallExpr *CE, CheckerContext &C) const ;
209+ #endif
206210 void checkPreCall (const CallEvent &Call, CheckerContext &C) const ;
207211 void checkPostCall (const CallEvent &Call, CheckerContext &C) const ;
208212 void checkPostStmt (const CStyleCastExpr *CE, CheckerContext &C) const ;
@@ -1216,10 +1220,17 @@ void GCChecker::checkPreCall(const CallEvent &Call, CheckerContext &C) const {
12161220 }
12171221}
12181222
1223+ #if LLVM_VERSION_MAJOR >= 9
1224+ bool GCChecker::evalCall (const CallEvent &Call,
1225+ #else
12191226bool GCChecker::evalCall (const CallExpr *CE,
1227+ #endif
12201228 CheckerContext &C) const {
12211229 // These checks should have no effect on the surrounding environment
12221230 // (globals should not be invalidated, etc), hence the use of evalCall.
1231+ #if LLVM_VERSION_MAJOR >= 9
1232+ const CallExpr *CE = dyn_cast<CallExpr>(Call.getOriginExpr ());
1233+ #endif
12231234 unsigned CurrentDepth = C.getState ()->get <GCDepth>();
12241235 auto name = C.getCalleeName (CE);
12251236 SValExplainer Ex (C.getASTContext ());
0 commit comments