Skip to content

[llvm-dwarfdump] Remove an unnecessary cast (NFC) #148117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

&DICtx is already of DWARFContext *.

&DICtx is already of DWARFContext *.
@llvmbot
Copy link
Member

llvmbot commented Jul 11, 2025

@llvm/pr-subscribers-debuginfo

Author: Kazu Hirata (kazutakahirata)

Changes

&DICtx is already of DWARFContext *.


Full diff: https://github.com/llvm/llvm-project/pull/148117.diff

1 Files Affected:

  • (modified) llvm/tools/llvm-dwarfdump/Statistics.cpp (+1-1)
diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp
index f92b2b55fa8dc..a705e7d51d874 100644
--- a/llvm/tools/llvm-dwarfdump/Statistics.cpp
+++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp
@@ -878,7 +878,7 @@ bool dwarfdump::collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
   DenseSet<LineTuple> UniqueLines;
   DenseSet<LineTuple> UniqueNonZeroLines;
 
-  for (const auto &CU : static_cast<DWARFContext *>(&DICtx)->compile_units()) {
+  for (const auto &CU : DICtx.compile_units()) {
     if (DWARFDie CUDie = CU->getNonSkeletonUnitDIE(false)) {
       // This variable holds variable information for functions with
       // abstract_origin, but just for the current CU.

@kazutakahirata kazutakahirata merged commit 8ba7d80 into llvm:main Jul 11, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250710_cast_llvm_dwarfdump branch July 11, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants