citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 14e70f2aaba2d7a73fd5aefce4d391b8802bb481
parent e27a34bb1176b2d08fb598f749397d9cceadaf14
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Fri, 24 Feb 2023 01:46:37 +0000

inst: fix build for llvm 13

Diffstat:
Minst/action.cc | 2+-
Minst/fe.cc | 7++++---
Minst/log.h | 2+-
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/inst/action.cc b/inst/action.cc @@ -40,7 +40,7 @@ InstrumentAction::write_modified_src(clang::FileID const &fid) std::string out_file(getCurrentFile()); std::error_code ec; - llvm::raw_fd_ostream output(out_file, ec, llvm::sys::fs::F_None); + llvm::raw_fd_ostream output(out_file, ec, llvm::sys::fs::OF_None); if (ec.value()) { m_log << "Error writing modified source '" << out_file << "': " << ec.message() << std::endl; diff --git a/inst/fe.cc b/inst/fe.cc @@ -235,10 +235,11 @@ InstFrontend::instrument() #endif int clang_argc = clang_argv.size(); - clang::tooling::CommonOptionsParser - op(clang_argc, &clang_argv[0], ToolingCategory); + llvm::Expected<clang::tooling::CommonOptionsParser> op = + clang::tooling::CommonOptionsParser::create( + clang_argc, &clang_argv[0], ToolingCategory); clang::tooling::ClangTool - Tool(op.getCompilations(), op.getSourcePathList()); + Tool(op->getCompilations(), op->getSourcePathList()); // // Ignore all errors/warnings by default. diff --git a/inst/log.h b/inst/log.h @@ -31,7 +31,7 @@ class InstrumentLogger : public std::ostream std::error_code m_ec; m_out = new llvm::raw_fd_ostream("citrun.log", m_ec, - llvm::sys::fs::F_Append | llvm::sys::fs::F_Text); + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text); if (m_ec.value()) { m_out = &llvm::errs(); *m_out << "Can't open citrun.log: " << m_ec.message();