Skip to content

Commit faa5635

Browse files
committed
allow GCChecker to compile on LLVM9
1 parent cc1a43a commit faa5635

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/clangsa/GCChecker.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
12191226
bool 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

Comments
 (0)