Skip to content

Commit fee07c9

Browse files
Upgrade to LLVM 14.0.6
1 parent 39752d4 commit fee07c9

File tree

7 files changed

+30
-25
lines changed

7 files changed

+30
-25
lines changed

.gitlab-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ check-format:
3636
build-linux:
3737
stage: build
3838
needs: [check-format]
39-
image: $DOCKER_REGISTRY/rewriting/mc-asm/llvm:13-RTTI
39+
image: $DOCKER_REGISTRY/rewriting/mc-asm/llvm:14
4040
artifacts:
4141
name: "$CI_COMMIT_REF_NAME-$CI_JOB_NAME"
4242
paths:
@@ -53,7 +53,7 @@ build-linux:
5353

5454
build-windows:
5555
stage: build
56-
tags: [rewriting-windows]
56+
tags: [mcasm-windows]
5757
artifacts:
5858
paths:
5959
- mcasm*.whl

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ endif()
2121
# Now we can find pybind11
2222
find_package(pybind11 CONFIG REQUIRED)
2323

24-
find_package(LLVM 13 CONFIG REQUIRED)
24+
find_package(LLVM 14 CONFIG REQUIRED)
2525
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
2626

2727
include(AddLLVM)

Dockerfile.llvm

+13-8
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,22 @@ RUN cd cmake-3.18.4 && \
1919
cd .. && \
2020
rm -rf cmake-3.18.4
2121

22-
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz && \
23-
tar -xf llvm-13.0.0.src.tar.xz && \
24-
rm llvm-13.0.0.src.tar.xz
22+
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-14.0.6.src.tar.xz && \
23+
tar -xf llvm-14.0.6.src.tar.xz && \
24+
rm llvm-14.0.6.src.tar.xz
2525

2626
RUN mkdir llvm-build && \
2727
cd llvm-build && \
28-
cmake -G Ninja ../llvm-13.0.0.src -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBXML2=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_USE_LINKER=gold && \
28+
cmake -G Ninja ../llvm-14.0.6.src \
29+
-DLLVM_ENABLE_RTTI=ON \
30+
-DLLVM_ENABLE_ZLIB=OFF \
31+
-DLLVM_ENABLE_TERMINFO=OFF \
32+
-DLLVM_ENABLE_LIBXML2=OFF \
33+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
34+
-DLLVM_PARALLEL_LINK_JOBS=1 \
35+
-DLLVM_INCLUDE_BENCHMARKS=OFF \
36+
-DLLVM_LINK_LLVM_DYLIB=ON && \
2937
ninja-build && \
3038
ninja-build install && \
3139
cd .. && \
32-
rm -rf llvm-build llvm-13.0.0.src
33-
34-
# The later CI steps will need conan to be installed
35-
RUN pip install conan
40+
rm -rf llvm-build llvm-14.0.6.src

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ MCASM repository.
2727
- AArch64MCExpr.h (from `llvm/lib/Target/AArch64/MCTargetDesc/`)
2828
- MipsMCExpr.h (from `llvm/lib/Target/Mips/MCTargetDesc/`)
2929
* Project Name: LLVM
30-
* Project Version: 13.0
30+
* Project Version: 14.0.6
3131
* License: Apache License v2.0 with LLVM Exceptions

src/bind.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#include <llvm/MC/MCSectionMachO.h>
1515
#include <llvm/MC/MCStreamer.h>
1616
#include <llvm/MC/MCSubtargetInfo.h>
17+
#include <llvm/MC/TargetRegistry.h>
1718
#include <llvm/Support/Host.h>
1819
#include <llvm/Support/JSON.h>
1920
#include <llvm/Support/MemoryBuffer.h>
2021
#include <llvm/Support/SourceMgr.h>
21-
#include <llvm/Support/TargetRegistry.h>
2222
#include <llvm/Support/TargetSelect.h>
2323
#include <memory>
2424

@@ -222,7 +222,7 @@ void init_sections(std::shared_ptr<ParserState> State, bool NoExecStack) {
222222
py_dispatch(
223223
__func__,
224224
[](std::shared_ptr<ParserState> State, bool NoExecStack) {
225-
State->Str->MCStreamer::InitSections(NoExecStack);
225+
State->Str->MCStreamer::initSections(NoExecStack, *State->STI);
226226
},
227227
State, NoExecStack);
228228
}
@@ -782,7 +782,7 @@ void emit_nops(std::shared_ptr<ParserState> State, int64_t NumBytes,
782782
[](std::shared_ptr<ParserState> State, int64_t NumBytes,
783783
int64_t ControlledNopLength, std::shared_ptr<mc::SourceLocation> Loc) {
784784
State->Str->MCStreamer::emitNops(NumBytes, ControlledNopLength,
785-
unwrap(Loc));
785+
unwrap(Loc), *State->STI);
786786
},
787787
State, NumBytes, ControlledNopLength, Loc);
788788
}
@@ -806,8 +806,8 @@ void emit_code_alignment(std::shared_ptr<ParserState> State,
806806
__func__,
807807
[](std::shared_ptr<ParserState> State, unsigned ByteAlignment,
808808
unsigned MaxBytesToEmit) {
809-
State->Str->MCStreamer::emitCodeAlignment(ByteAlignment,
810-
MaxBytesToEmit);
809+
State->Str->MCStreamer::emitCodeAlignment(
810+
ByteAlignment, State->STI.get(), MaxBytesToEmit);
811811
},
812812
State, ByteAlignment, MaxBytesToEmit);
813813
}
@@ -1764,7 +1764,7 @@ class StreamerAdaptor : public FriendlyStreamer {
17641764
dispatch(&PyStreamer::change_section, wrap(Section), wrap(SubSection));
17651765
}
17661766

1767-
void InitSections(bool NoExecStack) override {
1767+
void initSections(bool NoExecStack, const MCSubtargetInfo& STI) override {
17681768
dispatch(&PyStreamer::init_sections, NoExecStack);
17691769
}
17701770

@@ -1999,8 +1999,8 @@ class StreamerAdaptor : public FriendlyStreamer {
19991999
wrap(Loc));
20002000
}
20012001

2002-
void emitNops(int64_t NumBytes, int64_t ControlledNopLength,
2003-
SMLoc Loc) override {
2002+
void emitNops(int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc,
2003+
const MCSubtargetInfo& STI) override {
20042004
dispatch(&PyStreamer::emit_nops, NumBytes, ControlledNopLength, wrap(Loc));
20052005
}
20062006

@@ -2011,7 +2011,7 @@ class StreamerAdaptor : public FriendlyStreamer {
20112011
ValueSize, MaxBytesToEmit);
20122012
}
20132013

2014-
void emitCodeAlignment(unsigned ByteAlignment,
2014+
void emitCodeAlignment(unsigned ByteAlignment, const MCSubtargetInfo* STI,
20152015
unsigned MaxBytesToEmit = 0) override {
20162016
dispatch(&PyStreamer::emit_code_alignment, ByteAlignment, MaxBytesToEmit);
20172017
}

src/mc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ std::shared_ptr<Diagnostic> mc::wrap(std::shared_ptr<ParserState> State,
7272
return std::make_shared<Diagnostic>(State, Diag);
7373
}
7474

75-
std::shared_ptr<Instruction> mc::wrap(std::shared_ptr<ParserState> State,
76-
const llvm::MCInst& Inst) {
77-
return std::make_shared<Instruction>(State, Inst);
75+
std::shared_ptr<mc::Instruction> mc::wrap(std::shared_ptr<ParserState> State,
76+
const llvm::MCInst& Inst) {
77+
return std::make_shared<mc::Instruction>(State, Inst);
7878
}
7979

8080
std::shared_ptr<InstructionDesc> mc::wrap(std::shared_ptr<ParserState> State,

src/state.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#include <llvm/MC/MCSectionMachO.h>
1818
#include <llvm/MC/MCStreamer.h>
1919
#include <llvm/MC/MCSubtargetInfo.h>
20+
#include <llvm/MC/TargetRegistry.h>
2021
#include <llvm/Support/MemoryBuffer.h>
2122
#include <llvm/Support/SourceMgr.h>
22-
#include <llvm/Support/TargetRegistry.h>
2323
#include <llvm/Support/TargetSelect.h>
2424
#include <memory>
2525

0 commit comments

Comments
 (0)