[llvm] 36ec4de - [LiveDebugValues] Fix a warning
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 22 10:57:27 PDT 2022
Author: Kazu Hirata
Date: 2022-08-22T10:57:16-07:00
New Revision: 36ec4deca56558e8912fc0708ac342f1f2ef4506
URL: https://github.com/llvm/llvm-project/commit/36ec4deca56558e8912fc0708ac342f1f2ef4506
DIFF: https://github.com/llvm/llvm-project/commit/36ec4deca56558e8912fc0708ac342f1f2ef4506.diff
LOG: [LiveDebugValues] Fix a warning
This patch fixes:
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h:330:5: error:
anonymous types declared in an anonymous union are an extension
[-Werror,-Wnested-anon-types]
Added:
Modified:
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
index f84bcaecac5d..373a38226d4f 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
@@ -326,11 +326,13 @@ struct ResolvedDbgOp {
/// DbgOp is a constant, meaning that for simple equality or const-ness checks
/// it is not necessary to lookup this ID.
struct DbgOpID {
+ struct IsConstIndexPair {
+ uint32_t IsConst : 1;
+ uint32_t Index : 31;
+ };
+
union {
- struct {
- uint32_t IsConst : 1;
- uint32_t Index : 31;
- } ID;
+ struct IsConstIndexPair ID;
uint32_t RawID;
};
More information about the llvm-commits
mailing list