[clang] [clang] Remove declarations without definitions (NFC) (PR #242170)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 21:02:12 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

This patch removes constructor, function, and method declarations that
have no definitions and no callers.

Assisted-by: Antigravity


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


5 Files Affected:

- (modified) clang/include/clang/AST/OpenMPClause.h (-2) 
- (modified) clang/include/clang/AST/TypeBase.h (-2) 
- (modified) clang/include/clang/CIR/LoweringHelpers.h (-10) 
- (modified) clang/lib/CIR/CodeGen/CIRGenFunction.h (-4) 
- (modified) clang/lib/CodeGen/CGExprAgg.cpp (-2) 


``````````diff
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 3fc2e696b1c2d..9a16b63c70222 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -10262,8 +10262,6 @@ class OMPChildren final
     getTrailingObjects<Stmt *>()[NumChildren] = S;
   }
 
-  void setChildren(ArrayRef<Stmt *> Children);
-
   /// Sets the list of variables for this clause.
   ///
   /// \param Clauses The list of clauses for the directive.
diff --git a/clang/include/clang/AST/TypeBase.h b/clang/include/clang/AST/TypeBase.h
index 56e31f25c26d6..7207ad8137566 100644
--- a/clang/include/clang/AST/TypeBase.h
+++ b/clang/include/clang/AST/TypeBase.h
@@ -5305,7 +5305,6 @@ template <typename Container> class FunctionEffectIterator {
   size_t Idx = 0;
 
 public:
-  FunctionEffectIterator();
   FunctionEffectIterator(const Container &O, size_t I) : Outer(&O), Idx(I) {}
   bool operator==(const FunctionEffectIterator &Other) const {
     return Idx == Other.Idx;
@@ -5432,7 +5431,6 @@ class FunctionEffectKindSet {
     }
 
   public:
-    iterator();
     iterator(const FunctionEffectKindSet &O, size_t I) : Outer(&O), Idx(I) {
       advanceToNextSetBit();
     }
diff --git a/clang/include/clang/CIR/LoweringHelpers.h b/clang/include/clang/CIR/LoweringHelpers.h
index c67153b28a512..eba455d47543c 100644
--- a/clang/include/clang/CIR/LoweringHelpers.h
+++ b/clang/include/clang/CIR/LoweringHelpers.h
@@ -33,16 +33,6 @@ template <typename StorageTy> StorageTy getZeroInitFromType(mlir::Type ty);
 template <> mlir::APInt getZeroInitFromType(mlir::Type ty);
 template <> mlir::APFloat getZeroInitFromType(mlir::Type ty);
 
-template <typename AttrTy, typename StorageTy>
-void convertToDenseElementsAttrImpl(cir::ConstArrayAttr attr,
-                                    llvm::SmallVectorImpl<StorageTy> &values);
-
-template <typename AttrTy, typename StorageTy>
-mlir::DenseElementsAttr
-convertToDenseElementsAttr(cir::ConstArrayAttr attr,
-                           const llvm::SmallVectorImpl<int64_t> &dims,
-                           mlir::Type type);
-
 std::optional<mlir::Attribute>
 lowerConstArrayAttr(cir::ConstArrayAttr constArr,
                     mlir::SymbolTableCollection &symbolTables,
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.h b/clang/lib/CIR/CodeGen/CIRGenFunction.h
index 7de0b470b44ee..9f0349d418ab6 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.h
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.h
@@ -2787,10 +2787,6 @@ class CIRGenFunction : public CIRGenTypeCache {
   ConditionalInfo emitConditionalBlocks(const AbstractConditionalOperator *e,
                                         const FuncTy &branchGenFunc);
 
-  mlir::Value emitTernaryOnBoolExpr(const clang::Expr *cond, mlir::Location loc,
-                                    const clang::Stmt *thenS,
-                                    const clang::Stmt *elseS);
-
   /// Build a "reference" to a va_list; this is either the address or the value
   /// of the expression, depending on how va_list is defined.
   Address emitVAListRef(const Expr *e);
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 73c6301c5d585..d4602056b1518 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -227,8 +227,6 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
 
   void VisitVAArgExpr(VAArgExpr *E);
   void VisitCXXParenListInitExpr(CXXParenListInitExpr *E);
-  void VisitCXXParenListOrInitListExpr(Expr *ExprToVisit, ArrayRef<Expr *> Args,
-                                       Expr *ArrayFiller);
 
   void EmitInitializationToLValue(Expr *E, LValue Address);
   void EmitNullInitializationToLValue(LValue Address);

``````````

</details>


https://github.com/llvm/llvm-project/pull/242170


More information about the cfe-commits mailing list