diff options
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.patch | 41 |
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 @@ | |||
1 | From 049cbc1bf259ab109160987cbd43a485069957a6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Marcin Naczk <marcin.naczk@intel.com> | ||
3 | Date: Tue, 17 May 2022 09:50:31 +0000 | ||
4 | Subject: [PATCH 2/2] LLVM13 changed MCContext constructor | ||
5 | |||
6 | For LLVM13, MCContext constructor changed. | ||
7 | In the list of arguments appeared MCSubtargetInfo which is not used by us. | ||
8 | ObjectFileInfo was removed from the list of arguments, so we need to set | ||
9 | it in the next command. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | Signed-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 | |||
17 | diff --git a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h | ||
18 | index 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 | -- | ||
40 | 2.35.3 | ||
41 | |||