[clang] d37cbda - [Hexagon] Define __ELF__ by default.
Sid Manning via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 21 14:10:49 PST 2020
Author: Sid Manning
Date: 2020-02-21T16:10:31-06:00
New Revision: d37cbda5f9a47a4206439632ef4fa1534e66f856
URL: https://github.com/llvm/llvm-project/commit/d37cbda5f9a47a4206439632ef4fa1534e66f856
DIFF: https://github.com/llvm/llvm-project/commit/d37cbda5f9a47a4206439632ef4fa1534e66f856.diff
LOG: [Hexagon] Define __ELF__ by default.
Differential Revision: https://reviews.llvm.org/D74972
Added:
Modified:
clang/lib/Basic/Targets/Hexagon.cpp
clang/test/Preprocessor/hexagon-predefines.c
compiler-rt/lib/builtins/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/Hexagon.cpp b/clang/lib/Basic/Targets/Hexagon.cpp
index fcf9e9cff31d..205601c359d0 100644
--- a/clang/lib/Basic/Targets/Hexagon.cpp
+++ b/clang/lib/Basic/Targets/Hexagon.cpp
@@ -24,6 +24,8 @@ void HexagonTargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__qdsp6__", "1");
Builder.defineMacro("__hexagon__", "1");
+ Builder.defineMacro("__ELF__");
+
// The macro __HVXDBL__ is deprecated.
bool DefineHvxDbl = false;
diff --git a/clang/test/Preprocessor/hexagon-predefines.c b/clang/test/Preprocessor/hexagon-predefines.c
index fd33a6667170..5be8b96e290d 100644
--- a/clang/test/Preprocessor/hexagon-predefines.c
+++ b/clang/test/Preprocessor/hexagon-predefines.c
@@ -96,3 +96,8 @@
// CHECK-V67HVX-128B: #define __HVX_LENGTH__ 128
// CHECK-V67HVX-128B: #define __HVX__ 1
// CHECK-V67HVX-128B: #define __hexagon__ 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv67 \
+// RUN: -target-feature +hvxv67 -target-feature +hvx-length128b %s | FileCheck \
+// RUN: %s -check-prefix CHECK-ELF
+// CHECK-ELF: #define __ELF__ 1
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 125a3a1b1476..21cac1c23539 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -492,7 +492,6 @@ set(armv7m_SOURCES ${arm_SOURCES})
set(armv7em_SOURCES ${arm_SOURCES})
# hexagon arch
-set(hexagon_SOURCES ${GENERIC_SOURCES} ${GENERIC_TF_SOURCES})
set(hexagon_SOURCES
hexagon/common_entry_exit_abi1.S
hexagon/common_entry_exit_abi2.S
@@ -524,6 +523,8 @@ set(hexagon_SOURCES
hexagon/udivsi3.S
hexagon/umoddi3.S
hexagon/umodsi3.S
+ ${GENERIC_SOURCES}
+ ${GENERIC_TF_SOURCES}
)
More information about the cfe-commits
mailing list