[llvm] Fix NDEBUG Wundef warning; NFC (PR #159539)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 02:50:25 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Sven van Haastregt (svenvh)

<details>
<summary>Changes</summary>

The `NDEBUG` macro is tested for defined-ness everywhere else.  The instance here triggers a warning when compiling with `-Wundef`.

---
Full diff: https://github.com/llvm/llvm-project/pull/159539.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp b/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
index d741695d4e53c..0a358d45b92ca 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
@@ -98,7 +98,7 @@ std::pair<uint32_t, uint32_t> getNumCountersAndCallsites(const Function &F) {
                "same total nr of callsites parameter");
         NumCallsites = V;
       }
-#if NDEBUG
+#ifdef NDEBUG
       if (NumCounters && NumCallsites)
         return std::make_pair(NumCounters, NumCallsites);
 #endif

``````````

</details>


https://github.com/llvm/llvm-project/pull/159539


More information about the llvm-commits mailing list