Commit 3caa2d33 authored by Vyacheslav Zakharin's avatar Vyacheslav Zakharin
Browse files

[libomptarget][NFC] Avoid gcc 5/6 issue with lambda captures.

Differential Revision: https://reviews.llvm.org/D95486
parent ad7aaa47
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -53,7 +53,8 @@ enum OpenMPInfoType : uint32_t {
  OMP_INFOTYPE_ALL = 0xffffffff,
};

static inline uint32_t getInfoLevel() {
// Add __attribute__((used)) to work around a bug in gcc 5/6.
static inline uint32_t __attribute__((used)) getInfoLevel() {
  static uint32_t InfoLevel = 0;
  static std::once_flag Flag{};
  std::call_once(Flag, []() {
@@ -64,7 +65,8 @@ static inline uint32_t getInfoLevel() {
  return InfoLevel;
}

static inline uint32_t getDebugLevel() {
// Add __attribute__((used)) to work around a bug in gcc 5/6.
static inline uint32_t __attribute__((used)) getDebugLevel() {
  static uint32_t DebugLevel = 0;
  static std::once_flag Flag{};
  std::call_once(Flag, []() {