From 769b21eaf2438ccba599c7ce0b16bb0ca289f425 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 13 Nov 2017 14:26:21 +0000 Subject: CompilerType: Add ability to retrieve an integral template argument Summary: Despite it's name, GetTemplateArgument was only really working for Type template arguments. This adds the ability to retrieve integral arguments as well (which I've needed for the std::bitset data formatter). I've done this by splitting the function into three pieces. The idea is that one first calls GetTemplateArgumentKind (first function) to determine the what kind of a parameter this is. Based on that, one can then use specialized functions to retrieve the correct value. Currently, I only implement two of these: GetTypeTemplateArgument and GetIntegralTemplateArgument. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39844 llvm-svn: 318040 --- lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp') diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp index 11245e1310b..f6d1f18cb59 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp @@ -153,12 +153,11 @@ bool lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() { .get(); if (m_pair_ptr) { auto __i_(valobj_sp->GetChildMemberWithName(g___i_, true)); - lldb::TemplateArgumentKind kind; if (!__i_) { m_pair_ptr = nullptr; return false; } - CompilerType pair_type(__i_->GetCompilerType().GetTemplateArgument(0, kind)); + CompilerType pair_type(__i_->GetCompilerType().GetTypeTemplateArgument(0)); std::string name; uint64_t bit_offset_ptr; uint32_t bitfield_bit_size_ptr; bool is_bitfield_ptr; pair_type = pair_type.GetFieldAtIndex(0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr); if (!pair_type) { -- cgit v1.2.3