Commit d424be0f authored by Jan Vesely's avatar Jan Vesely
Browse files

clover: Fix build after llvm r332881.

v2: fix whitespace and indentation

r332881 added an extra parameter to the emit function.

Signed-off-by: default avatarJan Vesely <>
Reviewed-By: default avatarAaron Watry <>
Tested-By: default avatarAaron Watry <>
Tested-by: default avatarKai Wasserbäch <>
parent 3ac5fbad
......@@ -126,13 +126,12 @@ namespace {
compat::pass_manager pm;
::llvm::raw_svector_ostream os { data };
compat::raw_ostream_to_emit_file fos(os);
tm->Options.MCOptions.AsmVerbose =
(ft == TargetMachine::CGFT_AssemblyFile);
if (tm->addPassesToEmitFile(pm, fos, ft))
if (compat::add_passes_to_emit_file(*tm, pm, os, ft))
fail(r_log, build_error(), "TargetMachine can't emit this file");;
......@@ -245,6 +245,17 @@ namespace clover {
::llvm::WriteBitcodeToFile(mod, os);
::llvm::WriteBitcodeToFile(&mod, os);
template<typename TM, typename PM, typename OS, typename FT>
bool add_passes_to_emit_file(TM &tm, PM &pm, OS &os, FT &ft)
compat::raw_ostream_to_emit_file fos(os);
#if HAVE_LLVM >= 0x0700
return tm.addPassesToEmitFile(pm, fos, nullptr, ft);
return tm.addPassesToEmitFile(pm, fos, ft);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment