summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2018-05-22 17:52:30 -0400
committerJan Vesely <[email protected]>2018-05-29 17:36:16 -0400
commitd424be0feda503307692db8447f5989fa8e4a843 (patch)
treec7271875402f060e59346290ebee146de8730b48 /src/gallium/state_trackers
parent3ac5fbadfd8644d30fce9ff267cb811ad157996a (diff)
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: Jan Vesely <[email protected]> Reviewed-By: Aaron Watry <[email protected]> Tested-By: Aaron Watry <[email protected]> Tested-by: Kai Wasserbäch <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/llvm/codegen/native.cpp3
-rw-r--r--src/gallium/state_trackers/clover/llvm/compat.hpp11
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/codegen/native.cpp b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
index 409f8ac32f0..21f6c8c88a8 100644
--- a/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
+++ b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
@@ -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);
diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp b/src/gallium/state_trackers/clover/llvm/compat.hpp
index 2e070b2eefc..42a671b7fa3 100644
--- a/src/gallium/state_trackers/clover/llvm/compat.hpp
+++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
@@ -247,6 +247,17 @@ namespace clover {
::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
+ }
}
}
}