Skip to content

[clang] Remove unused declarations in CGDebugInfo (NFC) - #239487

Open
kazutakahirata wants to merge 1 commit into
llvm:mainfrom
kazutakahirata:cleanup_20261105_rm_unused_CGDebugInfo
Open

kazutakahirata wants to merge 1 commit into
llvm:mainfrom
kazutakahirata:cleanup_20261105_rm_unused_CGDebugInfo

Conversation

@kazutakahirata

Copy link
Copy Markdown
Contributor

SaveAndRestoreLocation: The class was removed on January 14, 2015 in
commit 66e4197, leaving its friend
declaration in CGDebugInfo dangling.

CGDebugInfo::OCLNDRangeDITy: The last use was removed on February 16,
2017 in commit 58984e7.

CGDebugInfo::Int8_4PackedTy and CGDebugInfo::UInt8_4PackedTy: These
fields were added via HLSLPackedTypes.def on September 30, 2026 in
commit 9488c46 without any uses.

Note that CGDebugInfo becomes fully defined in CGDebugInfo.cpp once we
remove the friend declaration for SaveAndRestoreLocation. That in turn
causes -Wunused-private-field to diagnose the unused private fields
removed here.

Assisted-by: Antigravity

SaveAndRestoreLocation: The class was removed on January 14, 2015 in
commit 66e4197, leaving its friend
declaration in CGDebugInfo dangling.

CGDebugInfo::OCLNDRangeDITy: The last use was removed on February 16,
2017 in commit 58984e7.

CGDebugInfo::Int8_4PackedTy and CGDebugInfo::UInt8_4PackedTy: These
fields were added via HLSLPackedTypes.def on September 30, 2026 in
commit 9488c46 without any uses.

Note that CGDebugInfo becomes fully defined in CGDebugInfo.cpp once we
remove the friend declaration for SaveAndRestoreLocation.  That in turn
causes -Wunused-private-field to diagnose the unused private fields
removed here.

Assisted-by: Antigravity
@llvmorg-github-actions llvmorg-github-actions Bot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. debuginfo labels Nov 6, 2026
@llvmorg-github-actions

llvmorg-github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

@llvm/pr-subscribers-clang-codegen

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

SaveAndRestoreLocation: The class was removed on January 14, 2015 in
commit 66e4197, leaving its friend
declaration in CGDebugInfo dangling.

CGDebugInfo::OCLNDRangeDITy: The last use was removed on February 16,
2017 in commit 58984e7.

CGDebugInfo::Int8_4PackedTy and CGDebugInfo::UInt8_4PackedTy: These
fields were added via HLSLPackedTypes.def on September 30, 2026 in
commit 9488c46 without any uses.

Note that CGDebugInfo becomes fully defined in CGDebugInfo.cpp once we
remove the friend declaration for SaveAndRestoreLocation. That in turn
causes -Wunused-private-field to diagnose the unused private fields
removed here.

Assisted-by: Antigravity


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGDebugInfo.h (-5)
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index b70671821c920..316f7133b9bd6 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -58,7 +58,6 @@ class CGBlockInfo;
 /// backend.
 class CGDebugInfo {
   friend class ApplyDebugLocation;
-  friend class SaveAndRestoreLocation;
   friend class ApplyAtomGroup;
 
   CodeGenModule &CGM;
@@ -84,7 +83,6 @@ class CGDebugInfo {
   llvm::DIType *OCLEventDITy = nullptr;
   llvm::DIType *OCLClkEventDITy = nullptr;
   llvm::DIType *OCLQueueDITy = nullptr;
-  llvm::DIType *OCLNDRangeDITy = nullptr;
   llvm::DIType *OCLReserveIDDITy = nullptr;
 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
   llvm::DIType *Id##Ty = nullptr;
@@ -97,9 +95,6 @@ class CGDebugInfo {
 #define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)                            \
   llvm::DIType *SingletonId = nullptr;
 #include "clang/Basic/HLSLIntangibleTypes.def"
-#define HLSL_PACKED_TYPE(Name, Id, SingletonId)                                \
-  llvm::DIType *SingletonId = nullptr;
-#include "clang/Basic/HLSLPackedTypes.def"
 #define SPIRV_TYPE(Name, Id, SingletonId) llvm::DIType *SingletonId = nullptr;
 #include "clang/Basic/SPIRVTypes.def"
 

@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-debuginfo

Author: Kazu Hirata (kazutakahirata)

Changes

SaveAndRestoreLocation: The class was removed on January 14, 2015 in
commit 66e4197, leaving its friend
declaration in CGDebugInfo dangling.

CGDebugInfo::OCLNDRangeDITy: The last use was removed on February 16,
2017 in commit 58984e7.

CGDebugInfo::Int8_4PackedTy and CGDebugInfo::UInt8_4PackedTy: These
fields were added via HLSLPackedTypes.def on September 30, 2026 in
commit 9488c46 without any uses.

Note that CGDebugInfo becomes fully defined in CGDebugInfo.cpp once we
remove the friend declaration for SaveAndRestoreLocation. That in turn
causes -Wunused-private-field to diagnose the unused private fields
removed here.

Assisted-by: Antigravity


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGDebugInfo.h (-5)
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index b70671821c920..316f7133b9bd6 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -58,7 +58,6 @@ class CGBlockInfo;
 /// backend.
 class CGDebugInfo {
   friend class ApplyDebugLocation;
-  friend class SaveAndRestoreLocation;
   friend class ApplyAtomGroup;
 
   CodeGenModule &CGM;
@@ -84,7 +83,6 @@ class CGDebugInfo {
   llvm::DIType *OCLEventDITy = nullptr;
   llvm::DIType *OCLClkEventDITy = nullptr;
   llvm::DIType *OCLQueueDITy = nullptr;
-  llvm::DIType *OCLNDRangeDITy = nullptr;
   llvm::DIType *OCLReserveIDDITy = nullptr;
 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
   llvm::DIType *Id##Ty = nullptr;
@@ -97,9 +95,6 @@ class CGDebugInfo {
 #define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)                            \
   llvm::DIType *SingletonId = nullptr;
 #include "clang/Basic/HLSLIntangibleTypes.def"
-#define HLSL_PACKED_TYPE(Name, Id, SingletonId)                                \
-  llvm::DIType *SingletonId = nullptr;
-#include "clang/Basic/HLSLPackedTypes.def"
 #define SPIRV_TYPE(Name, Id, SingletonId) llvm::DIType *SingletonId = nullptr;
 #include "clang/Basic/SPIRVTypes.def"
 

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category debuginfo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant