[Lldb-commits] [lldb] [LLDB] Fix warnings in DIL. (PR #134778)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 7 20:54:45 PDT 2025
https://github.com/cmtice created https://github.com/llvm/llvm-project/pull/134778
This fixes 3 warnings from compiling the DILParser:
DILParser.h:53:12: warning: returning address of local temporary object [-Wreturn-stack-address]
DILParser.h:119:8: warning: private field 'm_fragile_ivar' is not used [-Wunused-private-field]
DILParser.h:120:8: warning: private field 'm_check_ptr_vs_member' is not used [-Wunused-private-field]
>From a683bad89abeef9d1adacc99bb6ba3aa3b75a35e Mon Sep 17 00:00:00 2001
From: Caroline Tice <cmtice at google.com>
Date: Mon, 7 Apr 2025 20:51:08 -0700
Subject: [PATCH] [LLDB] Fix warnings in DIL.
This fixes 3 warnings from compiling the DILParser:
DILParser.h:53:12: warning: returning address of local temporary object
[-Wreturn-stack-address]
DILParser.h:119:8: warning: private field 'm_fragile_ivar' is not used
[-Wunused-private-field]
DILParser.h:120:8: warning: private field 'm_check_ptr_vs_member' is not used
[-Wunused-private-field]
---
lldb/include/lldb/ValueObject/DILParser.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lldb/include/lldb/ValueObject/DILParser.h b/lldb/include/lldb/ValueObject/DILParser.h
index 9b7a6cd487939..d1a991c2cc94c 100644
--- a/lldb/include/lldb/ValueObject/DILParser.h
+++ b/lldb/include/lldb/ValueObject/DILParser.h
@@ -50,7 +50,7 @@ class DILDiagnosticError
}
llvm::ArrayRef<DiagnosticDetail> GetDetails() const override {
- return {m_detail};
+ return m_detail;
}
std::string message() const override { return m_detail.rendered; }
@@ -116,8 +116,10 @@ class DILParser {
lldb::DynamicValueType m_use_dynamic;
bool m_use_synthetic;
- bool m_fragile_ivar;
- bool m_check_ptr_vs_member;
+ // The following are not currently used, but will be used as more
+ // functionality is added to DIL.
+ bool m_fragile_ivar __attribute__((unused));
+ bool m_check_ptr_vs_member __attribute__((unused));
}; // class DILParser
} // namespace lldb_private::dil
More information about the lldb-commits
mailing list