-
Notifications
You must be signed in to change notification settings - Fork 15.8k
[LLDB][NFC] Remove excessive use of auto from MSVC STL formatters
#175019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
@llvm/pr-subscribers-lldb Author: Nerixyz (Nerixyz) ChangesSome MSVC STL formatters made excessive use of Full diff: https://github.com/llvm/llvm-project/pull/175019.diff 4 Files Affected:
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp
index 0e5464448c686..7973e4f01bf3e 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlAtomic.cpp
@@ -99,11 +99,11 @@ lldb_private::formatters::MsvcStlAtomicSyntheticFrontEndCreator(
bool lldb_private::formatters::MsvcStlAtomicSummaryProvider(
ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
- auto synth_sp = valobj.GetSyntheticValue();
+ ValueObjectSP synth_sp = valobj.GetSyntheticValue();
if (!synth_sp)
return false;
- auto value_sp = synth_sp->GetChildAtIndex(0);
+ ValueObjectSP value_sp = synth_sp->GetChildAtIndex(0);
std::string summary;
if (value_sp->GetSummaryAsCString(summary, options) && !summary.empty()) {
stream << summary;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlDeque.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlDeque.cpp
index 5330f692bd7a9..7fd1e6691a4bd 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlDeque.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlDeque.cpp
@@ -96,25 +96,27 @@ lldb_private::formatters::MsvcStlDequeSyntheticFrontEnd::Update() {
m_map = nullptr;
m_element_type.Clear();
- auto storage_sp = m_backend.GetChildAtNamePath({"_Mypair", "_Myval2"});
+ ValueObjectSP storage_sp =
+ m_backend.GetChildAtNamePath({"_Mypair", "_Myval2"});
if (!storage_sp)
return lldb::eRefetch;
- auto deque_type = m_backend.GetCompilerType();
+ CompilerType deque_type = m_backend.GetCompilerType();
if (!deque_type)
return lldb::eRefetch;
- auto block_size_decl = deque_type.GetStaticFieldWithName("_Block_size");
+ CompilerDecl block_size_decl =
+ deque_type.GetStaticFieldWithName("_Block_size");
if (!block_size_decl)
return lldb::eRefetch;
- auto block_size = block_size_decl.GetConstantValue();
+ Scalar block_size = block_size_decl.GetConstantValue();
if (!block_size.IsValid())
return lldb::eRefetch;
- auto offset_sp = storage_sp->GetChildMemberWithName("_Myoff");
- auto map_size_sp = storage_sp->GetChildMemberWithName("_Mapsize");
- auto map_sp = storage_sp->GetChildMemberWithName("_Map");
- auto size_sp = storage_sp->GetChildMemberWithName("_Mysize");
+ ValueObjectSP offset_sp = storage_sp->GetChildMemberWithName("_Myoff");
+ ValueObjectSP map_size_sp = storage_sp->GetChildMemberWithName("_Mapsize");
+ ValueObjectSP map_sp = storage_sp->GetChildMemberWithName("_Map");
+ ValueObjectSP size_sp = storage_sp->GetChildMemberWithName("_Mysize");
if (!offset_sp || !map_size_sp || !map_sp || !size_sp)
return lldb::eRefetch;
@@ -131,7 +133,7 @@ lldb_private::formatters::MsvcStlDequeSyntheticFrontEnd::Update() {
if (!ok)
return lldb::eRefetch;
- auto element_type = deque_type.GetTypeTemplateArgument(0);
+ CompilerType element_type = deque_type.GetTypeTemplateArgument(0);
if (!element_type) {
// PDB doesn't have the template type, so use the type of _Map (T**).
element_type = map_sp->GetCompilerType().GetPointeeType().GetPointeeType();
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
index 6f66540f3cba9..d72300171400a 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp
@@ -147,11 +147,12 @@ lldb_private::formatters::MsvcStlSmartPointerSyntheticFrontEnd::Update() {
if (!valobj_sp)
return lldb::ChildCacheState::eRefetch;
- auto ptr_obj_sp = valobj_sp->GetChildMemberWithName("_Ptr");
+ ValueObjectSP ptr_obj_sp = valobj_sp->GetChildMemberWithName("_Ptr");
if (!ptr_obj_sp)
return lldb::ChildCacheState::eRefetch;
- auto cast_ptr_sp = GetDesugaredSmartPointerValue(*ptr_obj_sp, *valobj_sp);
+ ValueObjectSP cast_ptr_sp =
+ GetDesugaredSmartPointerValue(*ptr_obj_sp, *valobj_sp);
if (!cast_ptr_sp)
return lldb::ChildCacheState::eRefetch;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp
index ddf6c27a3e003..566f92c39b1d8 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlTree.cpp
@@ -348,7 +348,7 @@ lldb_private::formatters::MsvcStlTreeSyntheticFrontEnd::GetIndexOfChildWithName(
lldb::ChildCacheState MsvcStlTreeIterSyntheticFrontEnd::Update() {
m_inner_sp = nullptr;
- auto node_sp = m_backend.GetChildMemberWithName("_Ptr");
+ ValueObjectSP node_sp = m_backend.GetChildMemberWithName("_Ptr");
if (!node_sp)
return lldb::eRefetch;
|
Member
|
Thank you! |
kshitijvp
pushed a commit
to kshitijvp/llvm-project
that referenced
this pull request
Jan 9, 2026
…lvm#175019) Some MSVC STL formatters made excessive use of `auto`, especially the `std::deque` one (llvm#172360 (review)). This PR replaces the uses with the concrete type.
Priyanshu3820
pushed a commit
to Priyanshu3820/llvm-project
that referenced
this pull request
Jan 18, 2026
…lvm#175019) Some MSVC STL formatters made excessive use of `auto`, especially the `std::deque` one (llvm#172360 (review)). This PR replaces the uses with the concrete type.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some MSVC STL formatters made excessive use of
auto, especially thestd::dequeone (#172360 (review)). This PR replaces the uses with the concrete type.