summarylogtreecommitdiffstats
path: root/8543 clover Fix build with llvm-12.patch
blob: 4c221d54446151d0c4ab0c1364cda7f911074119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 67b36d1e81dcdce97daa6eab4a6a7e60c6d3949a Mon Sep 17 00:00:00 2001
From: Vinson Lee <vlee@freedesktop.org>
Date: Sat, 16 Jan 2021 22:55:41 -0800
Subject: [PATCH] clover: Fix build with llvm-12.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix build error after LLVM commit c495dfe0268b ("[clang][cli] NFC:
Decrease the scope of ParseLangArgs parameters").

../src/gallium/frontends/clover/llvm/invocation.cpp: In function ‘std::unique_ptr<clang::CompilerInstance> {anonymous}::create_compiler_instance(const clover::device&, const string&, const std::vector<std::__cxx11::basic_string<char> >&, std::string&)’:
../src/gallium/frontends/clover/llvm/invocation.cpp:252:55: error: cannot convert ‘clang::PreprocessorOptions’ to ‘std::vector<std::__cxx11::basic_string<char> >&’
  252 |                                 c->getPreprocessorOpts(),
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                       |
      |                                                       clang::PreprocessorOptions

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 src/gallium/frontends/clover/llvm/invocation.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
index be0f3976b92..bcbec21cd1c 100644
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
@@ -249,7 +249,11 @@ namespace {
 
       c->getInvocation().setLangDefaults(c->getLangOpts(),
                                 compat::ik_opencl, ::llvm::Triple(target.triple),
+#if LLVM_VERSION_MAJOR >= 12
+                                c->getPreprocessorOpts().Includes,
+#else
                                 c->getPreprocessorOpts(),
+#endif
                                 get_language_version(opts, device_clc_version));
 
       c->createDiagnostics(new clang::TextDiagnosticPrinter(
-- 
GitLab