diff --git a/tools/mull-runner/MergeInstProfile.cpp b/tools/mull-runner/MergeInstProfile.cpp index c9d246db..2f4d4d0f 100644 --- a/tools/mull-runner/MergeInstProfile.cpp +++ b/tools/mull-runner/MergeInstProfile.cpp @@ -1,5 +1,6 @@ #include "MergeInstProfile.h" #include "mull/Diagnostics/Diagnostics.h" +#include #include #include #include @@ -25,6 +26,14 @@ bool mull::mergeRawInstProfile(Diagnostics &diagnostics, const std::string &inpu diagnostics.warning("cannot save indexed profile data: "s + ec.message()); return false; } + + // Since LLVM 14, llvm::InstrProfWriter::write returns a [[nodiscard]]-attributed + // llvm::Error. Propagate potential errors back to the caller to avoid trigger + // unused warnings +#if LLVM_VERSION_MAJOR >= 14 + return bool(writer.write(out)); +#else writer.write(out); return true; +#endif }