[flang-commits] [flang] [flang][debug] Don't generate debug for compiler-generated variables (PR #112423)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Wed Oct 16 10:01:34 PDT 2024


================
@@ -211,10 +211,13 @@ void AddDebugInfoPass::handleGlobalOp(fir::GlobalOp globalOp,
   if (result.first != fir::NameUniquer::NameKind::VARIABLE)
     return;
 
-  // Discard entries that describe a derived type. Usually start with '.c.',
-  // '.dt.' or '.n.'. It would be better if result of the deconstruct had a flag
-  // for such values so that we dont have to look at string values.
-  if (!result.second.name.empty() && result.second.name[0] == '.')
+  // Discard entries that describe a derived type. They start with either '.' or
+  // 'X'. We filter both of them out. Note that NameUniquer makes the name lower
+  // case so user variables should be safe. It would be better if result of the
+  // deconstruct had a flag for such values so that we dont have to look at
+  // string values.
+  if (!result.second.name.empty() &&
+      (result.second.name[0] == '.' || result.second.name[0] == 'X'))
----------------
abidh wrote:

Thanks for the suggestion. I have moved the code into a separate function.

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


More information about the flang-commits mailing list