[Mlir-commits] [llvm] [mlir] Introduce a "log level" support for DEBUG_TYPE (PR #150855)

Jacques Pienaar llvmlistbot at llvm.org
Mon Jul 28 04:16:24 PDT 2025


================
@@ -38,25 +40,52 @@
 
 using namespace llvm;
 
+/// Parse a debug type string into a pair of the debug type and the debug level.
+/// The expected format is "type[:level]", where the level is an optional
+/// integer.
+static std::pair<std::string, int> parseDebugType(StringRef DbgType) {
+  int Level = 0;
+  size_t ColonPos = DbgType.find(':');
+  if (ColonPos != StringRef::npos) {
+    StringRef LevelStr = DbgType.substr(ColonPos + 1);
+    DbgType = DbgType.take_front(ColonPos);
+    if (LevelStr.empty())
+      Level = -1;
----------------
jpienaar wrote:

Mm, so 'a' would enable but empty disables? E.g., why not just disable by not listing and treating any error as level 0/1?

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


More information about the Mlir-commits mailing list