Skip to content

Commit 0b4a3a1

Browse files
authored
Unrolled build for #146466
Rollup merge of #146466 - klensy:llvm-wrapper-c, r=cuviper llvm-wrapper: other cleanup Cleanup few things around llvm-wrapper: First commit removes unused macro, added back in #31709 it was used in `LLVMRustHasFeature`; second removes unused function, third one removes `jsbackend` llvm component - this is looks like remnants of some removed backend?
2 parents 9d82de1 + dbfa01b commit 0b4a3a1

File tree

3 files changed

+0
-131
lines changed

3 files changed

+0
-131
lines changed

compiler/rustc_llvm/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const OPTIONAL_COMPONENTS: &[&str] = &[
1616
"mips",
1717
"powerpc",
1818
"systemz",
19-
"jsbackend",
2019
"webassembly",
2120
"msp430",
2221
"sparc",

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -79,122 +79,6 @@ extern "C" void LLVMRustTimeTraceProfilerFinish(const char *FileName) {
7979
timeTraceProfilerCleanup();
8080
}
8181

82-
#ifdef LLVM_COMPONENT_X86
83-
#define SUBTARGET_X86 SUBTARGET(X86)
84-
#else
85-
#define SUBTARGET_X86
86-
#endif
87-
88-
#ifdef LLVM_COMPONENT_ARM
89-
#define SUBTARGET_ARM SUBTARGET(ARM)
90-
#else
91-
#define SUBTARGET_ARM
92-
#endif
93-
94-
#ifdef LLVM_COMPONENT_AARCH64
95-
#define SUBTARGET_AARCH64 SUBTARGET(AArch64)
96-
#else
97-
#define SUBTARGET_AARCH64
98-
#endif
99-
100-
#ifdef LLVM_COMPONENT_AVR
101-
#define SUBTARGET_AVR SUBTARGET(AVR)
102-
#else
103-
#define SUBTARGET_AVR
104-
#endif
105-
106-
#ifdef LLVM_COMPONENT_M68k
107-
#define SUBTARGET_M68K SUBTARGET(M68k)
108-
#else
109-
#define SUBTARGET_M68K
110-
#endif
111-
112-
#ifdef LLVM_COMPONENT_CSKY
113-
#define SUBTARGET_CSKY SUBTARGET(CSKY)
114-
#else
115-
#define SUBTARGET_CSKY
116-
#endif
117-
118-
#ifdef LLVM_COMPONENT_MIPS
119-
#define SUBTARGET_MIPS SUBTARGET(Mips)
120-
#else
121-
#define SUBTARGET_MIPS
122-
#endif
123-
124-
#ifdef LLVM_COMPONENT_POWERPC
125-
#define SUBTARGET_PPC SUBTARGET(PPC)
126-
#else
127-
#define SUBTARGET_PPC
128-
#endif
129-
130-
#ifdef LLVM_COMPONENT_SYSTEMZ
131-
#define SUBTARGET_SYSTEMZ SUBTARGET(SystemZ)
132-
#else
133-
#define SUBTARGET_SYSTEMZ
134-
#endif
135-
136-
#ifdef LLVM_COMPONENT_MSP430
137-
#define SUBTARGET_MSP430 SUBTARGET(MSP430)
138-
#else
139-
#define SUBTARGET_MSP430
140-
#endif
141-
142-
#ifdef LLVM_COMPONENT_RISCV
143-
#define SUBTARGET_RISCV SUBTARGET(RISCV)
144-
#else
145-
#define SUBTARGET_RISCV
146-
#endif
147-
148-
#ifdef LLVM_COMPONENT_SPARC
149-
#define SUBTARGET_SPARC SUBTARGET(Sparc)
150-
#else
151-
#define SUBTARGET_SPARC
152-
#endif
153-
154-
#ifdef LLVM_COMPONENT_XTENSA
155-
#define SUBTARGET_XTENSA SUBTARGET(XTENSA)
156-
#else
157-
#define SUBTARGET_XTENSA
158-
#endif
159-
160-
#ifdef LLVM_COMPONENT_HEXAGON
161-
#define SUBTARGET_HEXAGON SUBTARGET(Hexagon)
162-
#else
163-
#define SUBTARGET_HEXAGON
164-
#endif
165-
166-
#ifdef LLVM_COMPONENT_LOONGARCH
167-
#define SUBTARGET_LOONGARCH SUBTARGET(LoongArch)
168-
#else
169-
#define SUBTARGET_LOONGARCH
170-
#endif
171-
172-
#define GEN_SUBTARGETS \
173-
SUBTARGET_X86 \
174-
SUBTARGET_ARM \
175-
SUBTARGET_AARCH64 \
176-
SUBTARGET_AVR \
177-
SUBTARGET_M68K \
178-
SUBTARGET_CSKY \
179-
SUBTARGET_MIPS \
180-
SUBTARGET_PPC \
181-
SUBTARGET_SYSTEMZ \
182-
SUBTARGET_MSP430 \
183-
SUBTARGET_SPARC \
184-
SUBTARGET_HEXAGON \
185-
SUBTARGET_XTENSA \
186-
SUBTARGET_RISCV \
187-
SUBTARGET_LOONGARCH
188-
189-
#define SUBTARGET(x) \
190-
namespace llvm { \
191-
extern const SubtargetFeatureKV x##FeatureKV[]; \
192-
extern const SubtargetFeatureKV x##SubTypeKV[]; \
193-
}
194-
195-
GEN_SUBTARGETS
196-
#undef SUBTARGET
197-
19882
// This struct and various functions are sort of a hack right now, but the
19983
// problem is that we've got in-memory LLVM modules after we generate and
20084
// optimize all codegen-units for one compilation in rustc. To be compatible
@@ -340,14 +224,6 @@ static FloatABI::ABIType fromRust(LLVMRustFloatABI RustFloatAbi) {
340224
report_fatal_error("Bad FloatABI.");
341225
}
342226

343-
/// getLongestEntryLength - Return the length of the longest entry in the table.
344-
template <typename KV> static size_t getLongestEntryLength(ArrayRef<KV> Table) {
345-
size_t MaxLen = 0;
346-
for (auto &I : Table)
347-
MaxLen = std::max(MaxLen, std::strlen(I.Key));
348-
return MaxLen;
349-
}
350-
351227
extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
352228
RustStringRef OutStr) {
353229
ArrayRef<SubtargetSubTypeKV> CPUTable =

compiler/rustc_llvm/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ pub fn initialize_available_targets() {
179179
LLVMInitializeSystemZAsmPrinter,
180180
LLVMInitializeSystemZAsmParser
181181
);
182-
init_target!(
183-
llvm_component = "jsbackend",
184-
LLVMInitializeJSBackendTargetInfo,
185-
LLVMInitializeJSBackendTarget,
186-
LLVMInitializeJSBackendTargetMC
187-
);
188182
init_target!(
189183
llvm_component = "msp430",
190184
LLVMInitializeMSP430TargetInfo,

0 commit comments

Comments
 (0)