Skip to content

Commit 090ab58

Browse files
authored
Revert "Automerge conflict: Config: Move LLVM_HAS_*_TARGET definitions to a new header." (#317)
This reverts #313 as the "squash and merge" method for closing the PR doesn't work well with the automerge script.
1 parent fa8c69f commit 090ab58

File tree

6 files changed

+79
-106
lines changed

6 files changed

+79
-106
lines changed

llvm/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,16 +1169,13 @@ if(NOT DEFINED ARM_TOOLCHAIN_ID)
11691169
endif()
11701170
# End downstream change: #124
11711171

1172-
# Configure the LLVM configuration header files.
1172+
# Configure the three LLVM configuration header files.
11731173
configure_file(
11741174
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/config.h.cmake
11751175
${LLVM_INCLUDE_DIR}/llvm/Config/config.h)
11761176
configure_file(
11771177
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config.h.cmake
11781178
${LLVM_INCLUDE_DIR}/llvm/Config/llvm-config.h)
1179-
configure_file(
1180-
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.h.cmake
1181-
${LLVM_INCLUDE_DIR}/llvm/Config/Targets.h)
11821179
configure_file(
11831180
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/abi-breaking.h.cmake
11841181
${LLVM_INCLUDE_DIR}/llvm/Config/abi-breaking.h)

llvm/include/llvm/Config/Targets.h.cmake

Lines changed: 0 additions & 90 deletions
This file was deleted.

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,81 @@
5454
/* LLVM name for the native target MCA init function, if available */
5555
#cmakedefine LLVM_NATIVE_TARGETMCA LLVMInitialize${LLVM_NATIVE_ARCH}TargetMCA
5656

57+
/* Define if the AArch64 target is built in */
58+
#cmakedefine01 LLVM_HAS_AARCH64_TARGET
59+
60+
/* Define if the AMDGPU target is built in */
61+
#cmakedefine01 LLVM_HAS_AMDGPU_TARGET
62+
63+
/* Define if the ARC target is built in */
64+
#cmakedefine01 LLVM_HAS_ARC_TARGET
65+
66+
/* Define if the ARM target is built in */
67+
#cmakedefine01 LLVM_HAS_ARM_TARGET
68+
69+
/* Define if the AVR target is built in */
70+
#cmakedefine01 LLVM_HAS_AVR_TARGET
71+
72+
/* Define if the BPF target is built in */
73+
#cmakedefine01 LLVM_HAS_BPF_TARGET
74+
75+
/* Define if the CSKY target is built in */
76+
#cmakedefine01 LLVM_HAS_CSKY_TARGET
77+
78+
/* Define if the DirectX target is built in */
79+
#cmakedefine01 LLVM_HAS_DIRECTX_TARGET
80+
81+
/* Define if the Hexagon target is built in */
82+
#cmakedefine01 LLVM_HAS_HEXAGON_TARGET
83+
84+
/* Define if the Lanai target is built in */
85+
#cmakedefine01 LLVM_HAS_LANAI_TARGET
86+
87+
/* Define if the LoongArch target is built in */
88+
#cmakedefine01 LLVM_HAS_LOONGARCH_TARGET
89+
90+
/* Define if the M68k target is built in */
91+
#cmakedefine01 LLVM_HAS_M68K_TARGET
92+
93+
/* Define if the Mips target is built in */
94+
#cmakedefine01 LLVM_HAS_MIPS_TARGET
95+
96+
/* Define if the MSP430 target is built in */
97+
#cmakedefine01 LLVM_HAS_MSP430_TARGET
98+
99+
/* Define if the NVPTX target is built in */
100+
#cmakedefine01 LLVM_HAS_NVPTX_TARGET
101+
102+
/* Define if the PowerPC target is built in */
103+
#cmakedefine01 LLVM_HAS_POWERPC_TARGET
104+
105+
/* Define if the RISCV target is built in */
106+
#cmakedefine01 LLVM_HAS_RISCV_TARGET
107+
108+
/* Define if the Sparc target is built in */
109+
#cmakedefine01 LLVM_HAS_SPARC_TARGET
110+
111+
/* Define if the SPIRV target is built in */
112+
#cmakedefine01 LLVM_HAS_SPIRV_TARGET
113+
114+
/* Define if the SystemZ target is built in */
115+
#cmakedefine01 LLVM_HAS_SYSTEMZ_TARGET
116+
117+
/* Define if the VE target is built in */
118+
#cmakedefine01 LLVM_HAS_VE_TARGET
119+
120+
/* Define if the WebAssembly target is built in */
121+
#cmakedefine01 LLVM_HAS_WEBASSEMBLY_TARGET
122+
123+
/* Define if the X86 target is built in */
124+
#cmakedefine01 LLVM_HAS_X86_TARGET
125+
126+
/* Define if the XCore target is built in */
127+
#cmakedefine01 LLVM_HAS_XCORE_TARGET
128+
129+
/* Define if the Xtensa target is built in */
130+
#cmakedefine01 LLVM_HAS_XTENSA_TARGET
131+
57132
/* Define if this is Unixish platform */
58133
#cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX}
59134

llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ write_cmake_config("abi-breaking") {
7474
}
7575

7676
write_cmake_config("config") {
77-
public_deps = [
78-
":Targets",
79-
":llvm-config",
80-
]
77+
public_deps = [ ":llvm-config" ]
8178

8279
input = "config.h.cmake"
8380
output = "$target_gen_dir/config.h"
@@ -387,12 +384,6 @@ write_cmake_config("llvm-config") {
387384
} else {
388385
values += [ "LLVM_FORCE_ENABLE_STATS=" ]
389386
}
390-
}
391-
392-
write_cmake_config("Targets") {
393-
input = "Targets.h.cmake"
394-
output = "$target_gen_dir/Targets.h"
395-
values = []
396387

397388
if (llvm_build_AArch64) {
398389
values += [ "LLVM_HAS_AARCH64_TARGET=1" ]

mlir/lib/Target/LLVM/NVVM/Target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "mlir/Target/LLVMIR/Export.h"
2828

2929
#include "llvm/ADT/ScopeExit.h"
30-
#include "llvm/Config/Targets.h"
30+
#include "llvm/Config/llvm-config.h"
3131
#include "llvm/Support/FileSystem.h"
3232
#include "llvm/Support/FileUtilities.h"
3333
#include "llvm/Support/FormatVariadic.h"

mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
2020

2121
#include "llvm/Bitcode/BitcodeWriter.h"
22-
#include "llvm/Config/Targets.h" // for LLVM_HAS_NVPTX_TARGET
22+
#include "llvm/Config/llvm-config.h" // for LLVM_HAS_NVPTX_TARGET
2323
#include "llvm/IRReader/IRReader.h"
2424
#include "llvm/Support/MemoryBufferRef.h"
2525
#include "llvm/Support/Process.h"

0 commit comments

Comments
 (0)