[llvm] [IR] Add per-function numbers to basic blocks (PR #101052)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 13:00:20 PDT 2024


================
@@ -996,6 +1012,12 @@ class LLVM_EXTERNAL_VISIBILITY Function : public GlobalObject,
   void setValueSubclassDataBit(unsigned Bit, bool On);
 };
 
+#ifdef NDEBUG
+/// In release builds, this is a no-op. For !NDEBUG builds, the checks are
+/// implemented in the .cpp file.
+inline void Function::validateBlockNumbers() const {}
+#endif
----------------
nikic wrote:

I'd prefer not to have the conditional definitions. Especially as the only callers are currently in the same file, there is no penalty to having the ifdef NDEBUG over the function body only.

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


More information about the llvm-commits mailing list