From 51f2824a4850a3566917e41ec1edb9a3b6e5d41f Mon Sep 17 00:00:00 2001 From: Brendan Dolan-Gavitt Date: Mon, 12 Aug 2024 22:13:49 +0000 Subject: [PATCH] fix llvm upgrade bugs --- tools/lavaTool/include/MatchFinder.h | 4 ++-- tools/lavaTool/src/lavaFnTool.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lavaTool/include/MatchFinder.h b/tools/lavaTool/include/MatchFinder.h index cbe3c359..f0e436cd 100644 --- a/tools/lavaTool/include/MatchFinder.h +++ b/tools/lavaTool/include/MatchFinder.h @@ -160,11 +160,11 @@ class LavaMatchFinder : public MatchFinder, public SourceFileCallbacks { ); } - // TODO: WARNING, I HAVE REMOVED OVERRIDE, I REALLY HOPE I DON'T REGRET THIS! - virtual bool handleBeginSource(CompilerInstance &CI, StringRef Filename) { + virtual bool handleBeginSource(CompilerInstance &CI) override { Insert.clear(); Mod.Reset(&CI.getLangOpts(), &CI.getSourceManager()); TUReplace.Replacements.clear(); + std::string Filename = CI.getSourceManager().getFileEntryForID(CI.getSourceManager().getMainFileID())->getName().str(); // Convert StringRef to std::string TUReplace.MainSourceFile = Filename; CurrentCI = &CI; diff --git a/tools/lavaTool/src/lavaFnTool.cpp b/tools/lavaTool/src/lavaFnTool.cpp index be75b343..eed2858f 100644 --- a/tools/lavaTool/src/lavaFnTool.cpp +++ b/tools/lavaTool/src/lavaFnTool.cpp @@ -156,7 +156,7 @@ class CallPrinter : public MatchFinder::MatchCallback { std::string fun_name = get_containing_function_name(Result, *call); outfile << " containing_function: " << fun_name << "\n"; - QualType rt = call->getDirectCallee()->getReturnType(); + QualType rt = call->getCallReturnType(*Result.Context); spit_type( " ret_type: ", rt); outfile << " args: \n"; for (auto it = call->arg_begin(); it != call->arg_end(); ++it) {