[clang] f3111cc - [clang][bytecode][NFC] Remove a useless cast

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 26 00:43:56 PDT 2024


Author: Timm Bäder
Date: 2024-09-26T09:43:38+02:00
New Revision: f3111cc77bea8d4f6b3ca90ee5457cff5faeb3fc

URL: https://github.com/llvm/llvm-project/commit/f3111cc77bea8d4f6b3ca90ee5457cff5faeb3fc
DIFF: https://github.com/llvm/llvm-project/commit/f3111cc77bea8d4f6b3ca90ee5457cff5faeb3fc.diff

LOG: [clang][bytecode][NFC] Remove a useless cast

getDecl() now always returns a ValueDecl.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/MemberPointer.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/MemberPointer.cpp b/clang/lib/AST/ByteCode/MemberPointer.cpp
index 0fe94db97a3c40..dfc8583e464abf 100644
--- a/clang/lib/AST/ByteCode/MemberPointer.cpp
+++ b/clang/lib/AST/ByteCode/MemberPointer.cpp
@@ -79,7 +79,7 @@ APValue MemberPointer::toAPValue(const ASTContext &ASTCtx) const {
   if (hasBase())
     return Base.toAPValue(ASTCtx);
 
-  return APValue(cast<ValueDecl>(getDecl()), /*IsDerivedMember=*/false,
+  return APValue(getDecl(), /*IsDerivedMember=*/false,
                  /*Path=*/{});
 }
 


        


More information about the cfe-commits mailing list