Skip to content

[NFC] use appropriate castas #95272

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

Closed

Conversation

mahesh-attarde
Copy link
Contributor

NFC fix for appropriate function call.
Requested by aaron while discussing #95257 #95257

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 clang:codegen IR generation bugs: mangling, exceptions, etc. labels Jun 12, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 12, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-codegen

Author: None (mahesh-attarde)

Changes

NFC fix for appropriate function call.
Requested by aaron while discussing #95257 #95257


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/Targets/X86.cpp (+1-1)
diff --git a/clang/lib/CodeGen/Targets/X86.cpp b/clang/lib/CodeGen/Targets/X86.cpp
index 43dadf5e724ac..433ceaa76c847 100644
--- a/clang/lib/CodeGen/Targets/X86.cpp
+++ b/clang/lib/CodeGen/Targets/X86.cpp
@@ -2834,7 +2834,7 @@ ABIArgInfo
 X86_64ABIInfo::classifyRegCallStructTypeImpl(QualType Ty, unsigned &NeededInt,
                                              unsigned &NeededSSE,
                                              unsigned &MaxVectorWidth) const {
-  auto RT = Ty->getAs<RecordType>();
+  auto RT = Ty->castAs<RecordType>();
   assert(RT && "classifyRegCallStructType only valid with struct types");
 
   if (RT->getDecl()->hasFlexibleArrayMember())

@llvmbot
Copy link
Member

llvmbot commented Jun 12, 2024

@llvm/pr-subscribers-backend-x86

Author: None (mahesh-attarde)

Changes

NFC fix for appropriate function call.
Requested by aaron while discussing #95257 #95257


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/Targets/X86.cpp (+1-1)
diff --git a/clang/lib/CodeGen/Targets/X86.cpp b/clang/lib/CodeGen/Targets/X86.cpp
index 43dadf5e724ac..433ceaa76c847 100644
--- a/clang/lib/CodeGen/Targets/X86.cpp
+++ b/clang/lib/CodeGen/Targets/X86.cpp
@@ -2834,7 +2834,7 @@ ABIArgInfo
 X86_64ABIInfo::classifyRegCallStructTypeImpl(QualType Ty, unsigned &NeededInt,
                                              unsigned &NeededSSE,
                                              unsigned &MaxVectorWidth) const {
-  auto RT = Ty->getAs<RecordType>();
+  auto RT = Ty->castAs<RecordType>();
   assert(RT && "classifyRegCallStructType only valid with struct types");
 
   if (RT->getDecl()->hasFlexibleArrayMember())

@mahesh-attarde
Copy link
Contributor Author

ping @AaronBallman

@@ -2834,7 +2834,7 @@ ABIArgInfo
X86_64ABIInfo::classifyRegCallStructTypeImpl(QualType Ty, unsigned &NeededInt,
unsigned &NeededSSE,
unsigned &MaxVectorWidth) const {
auto RT = Ty->getAs<RecordType>();
auto RT = Ty->castAs<RecordType>();
assert(RT && "classifyRegCallStructType only valid with struct types");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

castAs has an internal assert so drop this one?

@AaronBallman AaronBallman self-requested a review June 28, 2024 11:27
@mahesh-attarde mahesh-attarde deleted the NFC_fix_appropriate_cast branch November 8, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants