LLDB mainline
Generic.cpp
Go to the documentation of this file.
1//===-- Generic.cpp ------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===---------------------------------------------------------------------===//
8
9#include "Generic.h"
10#include "LibStdcpp.h"
11#include "MsvcStl.h"
12
14 ValueObject &ptr, ValueObject &container) {
15 auto container_type = container.GetCompilerType().GetNonReferenceType();
16 if (!container_type)
17 return nullptr;
18
19 auto arg = container_type.GetTypeTemplateArgument(0);
20 if (!arg)
21 // If there isn't enough debug info, use the pointer type as is
22 return ptr.GetSP();
23
24 return ptr.Cast(arg.GetPointerType());
25}
CompilerType GetTypeTemplateArgument(size_t idx, bool expand_pack=false) const
CompilerType GetNonReferenceType() const
If this type is a reference to a type (L value or R value reference), return a new type with the refe...
lldb::ValueObjectSP Cast(const CompilerType &compiler_type)
CompilerType GetCompilerType()
lldb::ValueObjectSP GetSP()
lldb::ValueObjectSP GetDesugaredSmartPointerValue(ValueObject &ptr, ValueObject &container)
Return the ValueObjectSP of the underlying pointer member whose type is a desugared 'std::shared_ptr:...
Definition Generic.cpp:13
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP