[llvm] c506adc - Move CLANG_SYSTEMZ_DEFAULT_ARCH to config.h.
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 11:16:29 PDT 2020
Author: Nico Weber
Date: 2020-03-30T14:16:17-04:00
New Revision: c506adcdf2ca3ba6459e52e09c55868e3b57af46
URL: https://github.com/llvm/llvm-project/commit/c506adcdf2ca3ba6459e52e09c55868e3b57af46
DIFF: https://github.com/llvm/llvm-project/commit/c506adcdf2ca3ba6459e52e09c55868e3b57af46.diff
LOG: Move CLANG_SYSTEMZ_DEFAULT_ARCH to config.h.
Instead of using a global define; see comments on D75914.
While here, port 9c9d88d8b1b to the GN build.
Added:
Modified:
clang/CMakeLists.txt
clang/include/clang/Config/config.h.cmake
clang/lib/Driver/ToolChains/Arch/SystemZ.cpp
llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
Removed:
################################################################################
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index c9e76c5e4518..88e556fd88a0 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -306,9 +306,7 @@ if (NOT DEFINED MATCHED_ARCH OR "${CMAKE_MATCH_1}" LESS 35)
"Default architecture for OpenMP offloading to Nvidia GPUs." FORCE)
endif()
-set(CLANG_SYSTEMZ_DEFAULT_ARCH "z10" CACHE STRING
- "SystemZ Default Arch")
-add_definitions( -DCLANG_SYSTEMZ_DEFAULT_ARCH="${CLANG_SYSTEMZ_DEFAULT_ARCH}")
+set(CLANG_SYSTEMZ_DEFAULT_ARCH "z10" CACHE STRING "SystemZ Default Arch")
set(CLANG_VENDOR ${PACKAGE_VENDOR} CACHE STRING
"Vendor-specific text for showing with version information.")
diff --git a/clang/include/clang/Config/config.h.cmake b/clang/include/clang/Config/config.h.cmake
index 261b3841b86f..a0f8b6b1b0da 100644
--- a/clang/include/clang/Config/config.h.cmake
+++ b/clang/include/clang/Config/config.h.cmake
@@ -83,4 +83,7 @@
/* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */
#cmakedefine01 CLANG_SPAWN_CC1
+/* Default <path> to all compiler invocations for --sysroot=<path>. */
+#define CLANG_SYSTEMZ_DEFAULT_ARCH "${CLANG_SYSTEMZ_DEFAULT_ARCH}"
+
#endif
diff --git a/clang/lib/Driver/ToolChains/Arch/SystemZ.cpp b/clang/lib/Driver/ToolChains/Arch/SystemZ.cpp
index b263fb7df09e..f81bf68172de 100644
--- a/clang/lib/Driver/ToolChains/Arch/SystemZ.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/SystemZ.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "SystemZ.h"
+#include "clang/Config/config.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Options.h"
#include "llvm/Option/ArgList.h"
diff --git a/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn b/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
index cc2c4e19ad49..7fbfb46a41c5 100644
--- a/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
@@ -36,6 +36,7 @@ write_cmake_config("Config") {
"ENABLE_X86_RELAX_RELOCATIONS=",
"ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=",
"CLANG_ENABLE_OBJC_REWRITER=1", # FIXME: flag?
+ "CLANG_SYSTEMZ_DEFAULT_ARCH=z10",
]
if (clang_enable_arcmt) {
More information about the llvm-commits
mailing list