[Openmp-commits] [PATCH] D132976: [Libomptarget] Remove old workaround for GCC 5, 6 from libomptarget
Joseph Huber via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Aug 30 14:24:11 PDT 2022
jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, tianshilei1992, ye-luo, jdoerfert, ronlieb, vzakhari.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.
Some code previous needed the `used` attribute to prevent the GCC
compiler versions 5 and 6 from removing it. This is no longer required
as the minimum supported GCC version for LLVM 16 is >=7.1.0.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D132976
Files:
openmp/libomptarget/include/Debug.h
Index: openmp/libomptarget/include/Debug.h
===================================================================
--- openmp/libomptarget/include/Debug.h
+++ openmp/libomptarget/include/Debug.h
@@ -58,17 +58,7 @@
OMP_INFOTYPE_ALL = 0xffffffff,
};
-#define GCC_VERSION \
- (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-
-#if !defined(__clang__) && defined(__GNUC__) && GCC_VERSION < 70100
-#define USED __attribute__((used))
-#else
-#define USED
-#endif
-
-// Add __attribute__((used)) to work around a bug in gcc 5/6.
-USED inline std::atomic<uint32_t> &getInfoLevelInternal() {
+inline std::atomic<uint32_t> &getInfoLevelInternal() {
static std::atomic<uint32_t> InfoLevel;
static std::once_flag Flag{};
std::call_once(Flag, []() {
@@ -79,10 +69,9 @@
return InfoLevel;
}
-USED inline uint32_t getInfoLevel() { return getInfoLevelInternal().load(); }
+inline uint32_t getInfoLevel() { return getInfoLevelInternal().load(); }
-// Add __attribute__((used)) to work around a bug in gcc 5/6.
-USED inline uint32_t getDebugLevel() {
+inline uint32_t getDebugLevel() {
static uint32_t DebugLevel = 0;
static std::once_flag Flag{};
std::call_once(Flag, []() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132976.456797.patch
Type: text/x-patch
Size: 1261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220830/e3e1641d/attachment.bin>
More information about the Openmp-commits
mailing list