[llvm] [llvm-debuginfo-analyzer] Add support for parsing DWARF / CodeView SourceLanguage (PR #137223)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 12 09:39:57 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h llvm/lib/DebugInfo/LogicalView/Core/LVElement.cpp llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp llvm/tools/llvm-debuginfo-analyzer/Options.cpp llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
index 27dbbdf41..fb6d517c7 100644
--- a/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
@@ -1710,14 +1710,15 @@ void LVScopeCompileUnit::printExtra(raw_ostream &OS, bool Full) const {
if (options().getPrintFormatting()) {
if (options().getAttributeProducer())
printAttributes(OS, Full, "{Producer} ",
- const_cast<LVScopeCompileUnit *>(this), getProducer(),
- /*UseQuotes=*/true,
- /*PrintRef=*/false);
- if (auto SL = getSourceLanguage(); options().getAttributeLanguage() && SL.isValid())
+ const_cast<LVScopeCompileUnit *>(this), getProducer(),
+ /*UseQuotes=*/true,
+ /*PrintRef=*/false);
+ if (auto SL = getSourceLanguage();
+ options().getAttributeLanguage() && SL.isValid())
printAttributes(OS, Full, "{Language} ",
- const_cast<LVScopeCompileUnit *>(this), SL.getName(),
- /*UseQuotes=*/true,
- /*PrintRef=*/false);
+ const_cast<LVScopeCompileUnit *>(this), SL.getName(),
+ /*UseQuotes=*/true,
+ /*PrintRef=*/false);
}
// Reset file index, to allow its children to print the correct filename.
diff --git a/llvm/tools/llvm-debuginfo-analyzer/Options.cpp b/llvm/tools/llvm-debuginfo-analyzer/Options.cpp
index 23a8953c0..410d7b85b 100644
--- a/llvm/tools/llvm-debuginfo-analyzer/Options.cpp
+++ b/llvm/tools/llvm-debuginfo-analyzer/Options.cpp
@@ -89,7 +89,8 @@ cl::list<LVAttributeKind> cmdline::AttributeOptions(
"Element referenced across Compile Units."),
clEnumValN(LVAttributeKind::Inserted, "inserted",
"Generated inlined abstract references."),
- clEnumValN(LVAttributeKind::Language, "language", "Source language name."),
+ clEnumValN(LVAttributeKind::Language, "language",
+ "Source language name."),
clEnumValN(LVAttributeKind::Level, "level",
"Lexical scope level (File=0, Compile Unit=1)."),
clEnumValN(LVAttributeKind::Linkage, "linkage", "Linkage name."),
``````````
</details>
https://github.com/llvm/llvm-project/pull/137223
More information about the llvm-commits
mailing list