mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 05:48:07 +02:00
clover: Fix build after clang r370122.
../mesa/src/gallium/state_trackers/clover/llvm/invocation.cpp: In function ‘std::unique_ptr<clang::CompilerInstance> {anonymous}::create_compiler_instance(const clover::device&, const std::vector<std::__cxx11::basic_string<char> >&, std::string&)’:
../mesa/src/gallium/state_trackers/clover/llvm/invocation.cpp:203:81: error: no matching function for call to ‘clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, const char* const*, const char* const*, clang::DiagnosticsEngine&)’
203 | c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
| ^
In file included from /opt/llvm64/include/clang/Frontend/CompilerInstance.h:15,
from ../mesa/src/gallium/state_trackers/clover/llvm/codegen.hpp:37,
from ../mesa/src/gallium/state_trackers/clover/llvm/invocation.cpp:49:
/opt/llvm64/include/clang/Frontend/CompilerInvocation.h:157:15: note: candidate: ‘static bool clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, llvm::ArrayRef<const char*>, clang::DiagnosticsEngine&)’
157 | static bool CreateFromArgs(CompilerInvocation &Res,
| ^~~~~~~~~~~~~~
/opt/llvm64/include/clang/Frontend/CompilerInvocation.h:157:15: note: candidate expects 3 arguments, 4 provided
Signed-off-by: Hal Gentz <zegentzy@protonmail.com>
Reviewed-by: Aaron Watry <awatry@gmail.com>
This commit is contained in:
parent
e716a9e213
commit
55c912883c
2 changed files with 16 additions and 2 deletions
|
|
@ -167,6 +167,20 @@ namespace clover {
|
|||
#endif
|
||||
}
|
||||
|
||||
template<typename T> inline bool
|
||||
create_compiler_invocation_from_args(clang::CompilerInvocation &cinv,
|
||||
T copts,
|
||||
clang::DiagnosticsEngine &diag)
|
||||
{
|
||||
#if HAVE_LLVM >= 0x1000
|
||||
return clang::CompilerInvocation::CreateFromArgs(
|
||||
cinv, copts, diag);
|
||||
#else
|
||||
return clang::CompilerInvocation::CreateFromArgs(
|
||||
cinv, copts.data(), copts.data() + copts.size(), diag);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T, typename M>
|
||||
T get_abi_type(const T &arg_type, const M &mod) {
|
||||
#if HAVE_LLVM >= 0x0700
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ namespace {
|
|||
const target &target = dev.ir_target();
|
||||
const std::string &device_clc_version = dev.device_clc_version();
|
||||
|
||||
if (!clang::CompilerInvocation::CreateFromArgs(
|
||||
c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
|
||||
if (!compat::create_compiler_invocation_from_args(
|
||||
c->getInvocation(), copts, diag))
|
||||
throw invalid_build_options_error();
|
||||
|
||||
diag_buffer->FlushDiagnostics(diag);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue