Skip to content

[CIR][NFC] Remove duplicate code #145790

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
merged 1 commit into from
Jun 25, 2025
Merged

Conversation

andykaylor
Copy link
Contributor

This change removes a bit of code that was left as an artifact of a previous "not yet implemented" state. The implementation is in place, but the code to report an NYI diagnostic was left behind.

This change removes a bit of code that was left as an artifact of a
previous "not yet implemented" state. The implementation is in place,
but the code to report an NYI diagnostic was left behind.
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Jun 25, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 25, 2025

@llvm/pr-subscribers-clang

Author: Andy Kaylor (andykaylor)

Changes

This change removes a bit of code that was left as an artifact of a previous "not yet implemented" state. The implementation is in place, but the code to report an NYI diagnostic was left behind.


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

1 Files Affected:

  • (modified) clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp (-8)
diff --git a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
index f17eb73a9f968..05e8848884f7e 100644
--- a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
@@ -614,14 +614,6 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd, cir::RecordType *ty) {
     }
   }
 
-  if (llvm::isa<CXXRecordDecl>(rd) && !rd->isUnion() &&
-      !rd->hasAttr<FinalAttr>()) {
-    if (lowering.astRecordLayout.getNonVirtualSize() !=
-        lowering.astRecordLayout.getSize()) {
-      cgm.errorNYI(rd->getSourceRange(), "computeRecordLayout: CXXRecordDecl");
-    }
-  }
-
   // Fill in the record *after* computing the base type.  Filling in the body
   // signifies that the type is no longer opaque and record layout is complete,
   // but we may need to recursively layout rd while laying D out as a base type.

@llvmbot
Copy link
Member

llvmbot commented Jun 25, 2025

@llvm/pr-subscribers-clangir

Author: Andy Kaylor (andykaylor)

Changes

This change removes a bit of code that was left as an artifact of a previous "not yet implemented" state. The implementation is in place, but the code to report an NYI diagnostic was left behind.


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

1 Files Affected:

  • (modified) clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp (-8)
diff --git a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
index f17eb73a9f968..05e8848884f7e 100644
--- a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
@@ -614,14 +614,6 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd, cir::RecordType *ty) {
     }
   }
 
-  if (llvm::isa<CXXRecordDecl>(rd) && !rd->isUnion() &&
-      !rd->hasAttr<FinalAttr>()) {
-    if (lowering.astRecordLayout.getNonVirtualSize() !=
-        lowering.astRecordLayout.getSize()) {
-      cgm.errorNYI(rd->getSourceRange(), "computeRecordLayout: CXXRecordDecl");
-    }
-  }
-
   // Fill in the record *after* computing the base type.  Filling in the body
   // signifies that the type is no longer opaque and record layout is complete,
   // but we may need to recursively layout rd while laying D out as a base type.

@andykaylor
Copy link
Contributor Author

I'm merging this before review because another change that I'm ready to push for review depends on it.

@andykaylor andykaylor merged commit 79da5fe into llvm:main Jun 25, 2025
8 of 10 checks passed
@andykaylor andykaylor deleted the cir-dup-error branch June 25, 2025 21:46
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
This change removes a bit of code that was left as an artifact of a
previous "not yet implemented" state. The implementation is in place,
but the code to report an NYI diagnostic was left behind.
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
This change removes a bit of code that was left as an artifact of a
previous "not yet implemented" state. The implementation is in place,
but the code to report an NYI diagnostic was left behind.
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.

2 participants