[Openmp-commits] [openmp] 56cf3d6 - [Libomptarget] Remove old workaround for GCC 5, 6 from libomptarget

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 30 17:14:00 PDT 2022


Author: Joseph Huber
Date: 2022-08-30T19:13:48-05:00
New Revision: 56cf3d626ff0b0781737570140753a1ae99d1400

URL: https://github.com/llvm/llvm-project/commit/56cf3d626ff0b0781737570140753a1ae99d1400
DIFF: https://github.com/llvm/llvm-project/commit/56cf3d626ff0b0781737570140753a1ae99d1400.diff

LOG: [Libomptarget] Remove old workaround for GCC 5,6 from libomptarget

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.

Reviewed By: JonChesterfield, vzakhari

Differential Revision: https://reviews.llvm.org/D132976

Added: 
    

Modified: 
    openmp/libomptarget/include/Debug.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/include/Debug.h b/openmp/libomptarget/include/Debug.h
index 942f39fe9c1a..4e7da8b7d53f 100644
--- a/openmp/libomptarget/include/Debug.h
+++ b/openmp/libomptarget/include/Debug.h
@@ -58,17 +58,7 @@ enum OpenMPInfoType : uint32_t {
   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 @@ USED inline std::atomic<uint32_t> &getInfoLevelInternal() {
   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, []() {


        


More information about the Openmp-commits mailing list