Skip to content

Commit 9828495

Browse files
jakllschJorge Aparicio
authored and
Jorge Aparicio
committed
further enable the Sparc LLVM backend
1 parent e7c788a commit 9828495

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ do
18211821
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON"
18221822
fi
18231823

1824-
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430'"
1824+
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc'"
18251825
CMAKE_ARGS="$CMAKE_ARGS -G '$CFG_CMAKE_GENERATOR'"
18261826
CMAKE_ARGS="$CMAKE_ARGS $CFG_LLVM_SRC_DIR"
18271827

mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ endif
285285
# LLVM macros
286286
######################################################################
287287

288-
LLVM_OPTIONAL_COMPONENTS=x86 arm aarch64 mips powerpc pnacl systemz jsbackend msp430
288+
LLVM_OPTIONAL_COMPONENTS=x86 arm aarch64 mips powerpc pnacl systemz jsbackend msp430 sparc
289289
LLVM_REQUIRED_COMPONENTS=ipo bitreader bitwriter linker asmparser mcjit \
290290
interpreter instrumentation
291291

src/rustllvm/PassWrapper.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,21 @@ LLVMRustAddPass(LLVMPassManagerRef PM, LLVMPassRef rust_pass) {
146146
#define SUBTARGET_MSP430
147147
#endif
148148

149+
#ifdef LLVM_COMPONENT_SPARC
150+
#define SUBTARGET_SPARC SUBTARGET(Sparc)
151+
#else
152+
#define SUBTARGET_SPARC
153+
#endif
154+
149155
#define GEN_SUBTARGETS \
150156
SUBTARGET_X86 \
151157
SUBTARGET_ARM \
152158
SUBTARGET_AARCH64 \
153159
SUBTARGET_MIPS \
154160
SUBTARGET_PPC \
155161
SUBTARGET_SYSTEMZ \
156-
SUBTARGET_MSP430
162+
SUBTARGET_MSP430 \
163+
SUBTARGET_SPARC
157164

158165
#define SUBTARGET(x) namespace llvm { \
159166
extern const SubtargetFeatureKV x##FeatureKV[]; \

0 commit comments

Comments
 (0)