summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch')
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch
new file mode 100644
index 00000000..df6fa613
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch
@@ -0,0 +1,41 @@
1From 049cbc1bf259ab109160987cbd43a485069957a6 Mon Sep 17 00:00:00 2001
2From: Marcin Naczk <marcin.naczk@intel.com>
3Date: Tue, 17 May 2022 09:50:31 +0000
4Subject: [PATCH 2/2] LLVM13 changed MCContext constructor
5
6For LLVM13, MCContext constructor changed.
7In the list of arguments appeared MCSubtargetInfo which is not used by us.
8ObjectFileInfo was removed from the list of arguments, so we need to set
9it in the next command.
10
11Upstream-Status: Backport
12Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
13---
14 IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h | 11 +++++++----
15 1 file changed, 7 insertions(+), 4 deletions(-)
16
17diff --git a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h
18index 3725864ef..f3e7e2b4e 100644
19--- a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h
20+++ b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h
21@@ -24,10 +24,13 @@ namespace IGCLLVM
22 bool DoAutoReset = true)
23 {
24 #if LLVM_VERSION_MAJOR >= 13
25- std::string Err;
26- const llvm::Target *T = llvm::TargetRegistry::lookupTarget(TheTriple.str(), Err);
27- std::unique_ptr<llvm::MCSubtargetInfo> STI(T->createMCSubtargetInfo(TheTriple.str(), "", ""));
28- return new llvm::MCContext(TheTriple, MAI, MRI, STI.get(), Mgr, TargetOpts, DoAutoReset);
29+// Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo
30+//
31+// Differential Revision: https://reviews.llvm.org/D101921
32+
33+ auto *Context = new llvm::MCContext(TheTriple, MAI, MRI, nullptr, Mgr, TargetOpts, DoAutoReset);
34+ Context->setObjectFileInfo(MOFI);
35+ return Context;
36 #elif LLVM_VERSION_MAJOR >= 10
37 return new llvm::MCContext(MAI, MRI, MOFI, Mgr, TargetOpts, DoAutoReset);
38 #else
39--
402.35.3
41