[clang] [clang] Remove unused declarations in CGDebugInfo (NFC) (PR #239487)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 5 22:35:37 PST 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-debuginfo
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
SaveAndRestoreLocation: The class was removed on January 14, 2015 in
commit 66e4197f07f6a3fe178f2b220fce62a1889b5fe6, leaving its friend
declaration in CGDebugInfo dangling.
CGDebugInfo::OCLNDRangeDITy: The last use was removed on February 16,
2017 in commit 58984e7087bc530ac2fae06b3ef15a4f1bc118f9.
CGDebugInfo::Int8_4PackedTy and CGDebugInfo::UInt8_4PackedTy: These
fields were added via HLSLPackedTypes.def on September 30, 2026 in
commit 9488c46651de0fbec038e6b8578c1e651d89e576 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
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"
``````````
</details>
https://github.com/llvm/llvm-project/pull/239487
More information about the cfe-commits
mailing list