Skip to content

[IR] Remove an unnecessary cast (NFC) #146274

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

DT is already of DIType *.

DT is already of DIType *.
@llvmbot
Copy link
Member

llvmbot commented Jun 29, 2025

@llvm/pr-subscribers-llvm-ir

@llvm/pr-subscribers-debuginfo

Author: Kazu Hirata (kazutakahirata)

Changes

DT is already of DIType *.


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

1 Files Affected:

  • (modified) llvm/lib/IR/DebugInfo.cpp (+1-1)
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index ecb19fd3c82db..d4d8d0376375b 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -376,7 +376,7 @@ bool DebugInfoFinder::addType(DIType *DT) {
   if (!NodesSeen.insert(DT).second)
     return false;
 
-  TYs.push_back(const_cast<DIType *>(DT));
+  TYs.push_back(DT);
   return true;
 }
 

@kazutakahirata kazutakahirata merged commit 678ccd5 into llvm:main Jun 30, 2025
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250629_cast_llvm_IR branch June 30, 2025 02:19
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