[llvm] [llvm-debuginfo-analyzer] Add support for parsing DWARF / CodeView SourceLanguage (PR #137223)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 00:46:22 PDT 2025


================
@@ -1717,11 +1717,19 @@ void LVScopeCompileUnit::print(raw_ostream &OS, bool Full) const {
 
 void LVScopeCompileUnit::printExtra(raw_ostream &OS, bool Full) const {
   OS << formattedKind(kind()) << " '" << getName() << "'\n";
-  if (options().getPrintFormatting() && options().getAttributeProducer())
-    printAttributes(OS, Full, "{Producer} ",
-                    const_cast<LVScopeCompileUnit *>(this), getProducer(),
-                    /*UseQuotes=*/true,
-                    /*PrintRef=*/false);
+  if (options().getPrintFormatting()) {
+    if (options().getAttributeProducer())
+      printAttributes(OS, Full, "{Producer} ",
+                      const_cast<LVScopeCompileUnit *>(this), getProducer(),
+                      /*UseQuotes=*/true,
+                      /*PrintRef=*/false);
+    if (auto SL = getSourceLanguage();
----------------
CarlosAlbertoEnciso wrote:

May be:
```
if (options().getAttributeLanguage())
  if (auto SL = getSourceLanguage() && SL.isValid())
    ...
```
Get the language string only if the `language option` has been specified. 

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


More information about the llvm-commits mailing list