Skip to content

Conversation

andykaylor
Copy link
Contributor

This removes the getSize() member function from EHScopeStack::Cleanup and all its subclasses. This function had originally been added as a temporary measure before EHCleanupScope was implemented, but it is no longer used.

This removes the `getSize()` member function from EHScopeStack::Cleanup
and all its subclasses. This function had originally been added as a
temporary measure before EHCleanupScope was implemented, but it is no
longer used.
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Oct 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clangir

Author: Andy Kaylor (andykaylor)

Changes

This removes the getSize() member function from EHScopeStack::Cleanup and all its subclasses. This function had originally been added as a temporary measure before EHCleanupScope was implemented, but it is no longer used.


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

4 Files Affected:

  • (modified) clang/lib/CIR/CodeGen/CIRGenClass.cpp (-6)
  • (modified) clang/lib/CIR/CodeGen/CIRGenDecl.cpp (-6)
  • (modified) clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp (-6)
  • (modified) clang/lib/CIR/CodeGen/EHScopeStack.h (-3)
diff --git a/clang/lib/CIR/CodeGen/CIRGenClass.cpp b/clang/lib/CIR/CodeGen/CIRGenClass.cpp
index d9ebf19534dc4..599bef7cc6ce7 100644
--- a/clang/lib/CIR/CodeGen/CIRGenClass.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenClass.cpp
@@ -891,12 +891,6 @@ class DestroyField final : public EHScopeStack::Cleanup {
     assert(!cir::MissingFeatures::ehCleanupFlags());
     cgf.emitDestroy(lv.getAddress(), field->getType(), destroyer);
   }
-
-  // This is a placeholder until EHCleanupScope is implemented.
-  size_t getSize() const override {
-    assert(!cir::MissingFeatures::ehCleanupScope());
-    return sizeof(DestroyField);
-  }
 };
 } // namespace
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenDecl.cpp b/clang/lib/CIR/CodeGen/CIRGenDecl.cpp
index 563a753ab4efd..039d29033ea87 100644
--- a/clang/lib/CIR/CodeGen/CIRGenDecl.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenDecl.cpp
@@ -695,12 +695,6 @@ struct DestroyObject final : EHScopeStack::Cleanup {
   void emit(CIRGenFunction &cgf) override {
     cgf.emitDestroy(addr, type, destroyer);
   }
-
-  // This is a placeholder until EHCleanupScope is implemented.
-  size_t getSize() const override {
-    assert(!cir::MissingFeatures::ehCleanupScope());
-    return sizeof(DestroyObject);
-  }
 };
 } // namespace
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp b/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
index 4eb8ca8b5b397..bbc6a49a5e798 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
@@ -463,12 +463,6 @@ struct CallObjectDelete final : EHScopeStack::Cleanup {
   void emit(CIRGenFunction &cgf) override {
     cgf.emitDeleteCall(operatorDelete, ptr, elementType);
   }
-
-  // This is a placeholder until EHCleanupScope is implemented.
-  size_t getSize() const override {
-    assert(!cir::MissingFeatures::ehCleanupScope());
-    return sizeof(CallObjectDelete);
-  }
 };
 } // namespace
 
diff --git a/clang/lib/CIR/CodeGen/EHScopeStack.h b/clang/lib/CIR/CodeGen/EHScopeStack.h
index 66c1f76094c58..67a72f5384c32 100644
--- a/clang/lib/CIR/CodeGen/EHScopeStack.h
+++ b/clang/lib/CIR/CodeGen/EHScopeStack.h
@@ -108,9 +108,6 @@ class EHScopeStack {
     ///
     // \param flags cleanup kind.
     virtual void emit(CIRGenFunction &cgf) = 0;
-
-    // This is a placeholder until EHScope is implemented.
-    virtual size_t getSize() const = 0;
   };
 
 private:

Copy link
Contributor

@xlauko xlauko left a comment

Choose a reason for hiding this comment

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

lgtm

@andykaylor andykaylor merged commit 05e723e into llvm:main Oct 9, 2025
12 checks passed
svkeerthy pushed a commit that referenced this pull request Oct 9, 2025
…62565)

This removes the `getSize()` member function from EHScopeStack::Cleanup
and all its subclasses. This function had originally been added as a
temporary measure before EHCleanupScope was implemented, but it is no
longer used.
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.

5 participants