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.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106619

Signed-off-by: default avatarJan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: default avatarAaron Watry <awatry@gmail.com>
Tested-By: default avatarAaron Watry <awatry@gmail.com>
Tested-by: default avatarKai Wasserbäch <kai@dev.carbon-project.org>
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);
mod.setDataLayout(compat::get_data_layout(*tm));
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");
pm.run(mod);
......
......@@ -245,6 +245,17 @@ namespace clover {
::llvm::WriteBitcodeToFile(mod, os);
#else
::llvm::WriteBitcodeToFile(&mod, os);
#endif
}
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);
#else
return tm.addPassesToEmitFile(pm, fos, ft);
#endif
}
}
......
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