Skip to content

Conversation

@Andres-Salamanca
Copy link
Contributor

This PR addresses the error mentioned in #145067 (comment), which occurs on ARM when handling an unsupported bit-field case. The patch removes the error and replaces it with an assert, marking the missing feature.

@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Jun 24, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 24, 2025

@llvm/pr-subscribers-clang

Author: None (Andres-Salamanca)

Changes

This PR addresses the error mentioned in #145067 (comment), which occurs on ARM when handling an unsupported bit-field case. The patch removes the error and replaces it with an assert, marking the missing feature.


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

1 Files Affected:

  • (modified) clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp (+1-3)
diff --git a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
index 349c6e75ce36c..4643f6c1a9cef 100644
--- a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
@@ -778,10 +778,8 @@ void CIRRecordLowering::computeVolatileBitfields() {
       !cirGenTypes.getCGModule().getCodeGenOpts().AAPCSBitfieldWidth)
     return;
 
-  for ([[maybe_unused]] auto &I : bitFields) {
+  for ([[maybe_unused]] auto &I : bitFields)
     assert(!cir::MissingFeatures::armComputeVolatileBitfields());
-    cirGenTypes.getCGModule().errorNYI("NYI AAPCS bit-fields");
-  }
 }
 
 void CIRRecordLowering::accumulateBases(const CXXRecordDecl *cxxRecordDecl) {

@llvmbot
Copy link
Member

llvmbot commented Jun 24, 2025

@llvm/pr-subscribers-clangir

Author: None (Andres-Salamanca)

Changes

This PR addresses the error mentioned in #145067 (comment), which occurs on ARM when handling an unsupported bit-field case. The patch removes the error and replaces it with an assert, marking the missing feature.


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

1 Files Affected:

  • (modified) clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp (+1-3)
diff --git a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
index 349c6e75ce36c..4643f6c1a9cef 100644
--- a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
@@ -778,10 +778,8 @@ void CIRRecordLowering::computeVolatileBitfields() {
       !cirGenTypes.getCGModule().getCodeGenOpts().AAPCSBitfieldWidth)
     return;
 
-  for ([[maybe_unused]] auto &I : bitFields) {
+  for ([[maybe_unused]] auto &I : bitFields)
     assert(!cir::MissingFeatures::armComputeVolatileBitfields());
-    cirGenTypes.getCGModule().errorNYI("NYI AAPCS bit-fields");
-  }
 }
 
 void CIRRecordLowering::accumulateBases(const CXXRecordDecl *cxxRecordDecl) {

Copy link
Contributor

@andykaylor andykaylor left a comment

Choose a reason for hiding this comment

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

Thanks for handling this!

I have a minor comment, but let's just merge this as is to get the tests passing.

return;

for ([[maybe_unused]] auto &I : bitFields) {
for ([[maybe_unused]] auto &I : bitFields)
Copy link
Contributor

Choose a reason for hiding this comment

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

The for loop isn't really needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@andykaylor andykaylor merged commit 280f60e into llvm:main Jun 24, 2025
6 of 7 checks passed
DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
)

This PR addresses the error mentioned in
llvm#145067 (comment),
which occurs on ARM when handling an unsupported bit-field case. The
patch removes the error and replaces it with an assert, marking the
missing feature.
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
)

This PR addresses the error mentioned in
llvm#145067 (comment),
which occurs on ARM when handling an unsupported bit-field case. The
patch removes the error and replaces it with an assert, marking the
missing feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants