本文整理汇总了C++中TypeList::Types方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeList::Types方法的具体用法?C++ TypeList::Types怎么用?C++ TypeList::Types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeList
的用法示例。
在下文中一共展示了TypeList::Types方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Find_Impl
bool Find_Impl(ExecutionContextScope *exe_scope, const char *key,
ResultSet &results) override {
bool result = false;
Target *target = exe_scope->CalculateTarget().get();
if (target) {
const auto &images(target->GetImages());
SymbolContext null_sc;
ConstString cs_key(key);
llvm::DenseSet<SymbolFile*> searched_sym_files;
TypeList matches;
images.FindTypes(null_sc,
cs_key,
false,
UINT32_MAX,
searched_sym_files,
matches);
for (const auto& match : matches.Types()) {
if (match.get()) {
CompilerType compiler_type(match->GetFullCompilerType());
LanguageType lang_type(compiler_type.GetMinimumLanguage());
// other plugins will find types for other languages - here we only do C and C++
if (!Language::LanguageIsC(lang_type) && !Language::LanguageIsCPlusPlus(lang_type))
continue;
if (compiler_type.IsTypedefType())
compiler_type = compiler_type.GetTypedefedType();
std::unique_ptr<Language::TypeScavenger::Result> scavengeresult(
new CPlusPlusTypeScavengerResult(compiler_type));
results.insert(std::move(scavengeresult));
result = true;
}
}
}
return result;
}
示例2: exe_ctx
bool
TypeFormatImpl_EnumType::FormatObject (ValueObject *valobj,
std::string& dest) const
{
dest.clear();
if (!valobj)
return false;
if (!valobj->CanProvideValue())
return false;
ProcessSP process_sp;
TargetSP target_sp;
void* valobj_key = (process_sp = valobj->GetProcessSP()).get();
if (!valobj_key)
valobj_key = (target_sp = valobj->GetTargetSP()).get();
else
target_sp = process_sp->GetTarget().shared_from_this();
if (!valobj_key)
return false;
auto iter = m_types.find(valobj_key),
end = m_types.end();
CompilerType valobj_enum_type;
if (iter == end)
{
// probably a redundant check
if (!target_sp)
return false;
const ModuleList& images(target_sp->GetImages());
SymbolContext sc;
TypeList types;
images.FindTypes(sc, m_enum_type, false, UINT32_MAX, types);
if (types.GetSize() == 0)
return false;
for (lldb::TypeSP type_sp : types.Types())
{
if (!type_sp)
continue;
if ( (type_sp->GetForwardCompilerType().GetTypeInfo() & eTypeIsEnumeration) == eTypeIsEnumeration)
{
valobj_enum_type = type_sp->GetFullCompilerType ();
m_types.emplace(valobj_key,valobj_enum_type);
break;
}
}
}
else
valobj_enum_type = iter->second;
if (valobj_enum_type.IsValid() == false)
return false;
DataExtractor data;
Error error;
valobj->GetData(data, error);
if (error.Fail())
return false;
ExecutionContext exe_ctx (valobj->GetExecutionContextRef());
StreamString sstr;
valobj_enum_type.DumpTypeValue(&sstr,
lldb::eFormatEnum,
data,
0,
data.GetByteSize(),
0,
0,
exe_ctx.GetBestExecutionContextScope());
if (!sstr.GetString().empty())
dest.swap(sstr.GetString());
return !dest.empty();
}