本文整理汇总了C++中TypeMap::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeMap::GetSize方法的具体用法?C++ TypeMap::GetSize怎么用?C++ TypeMap::GetSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeMap
的用法示例。
在下文中一共展示了TypeMap::GetSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fspec
TEST_F(SymbolFilePDBTests, REQUIRES_DIA_SDK(TestMaxMatches)) {
FileSpec fspec(m_types_test_exe.c_str(), false);
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
SymbolContext sc;
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr,
false, 0, searched_files, results);
// Try to limit ourselves from 1 to 10 results, otherwise we could be doing
// this thousands of times.
// The idea is just to make sure that for a variety of values, the number of
// limited results always
// comes out to the number we are expecting.
uint32_t iterations = std::min(num_results, 10u);
for (uint32_t i = 1; i <= iterations; ++i) {
uint32_t num_limited_results = symfile->FindTypes(
sc, ConstString(".*"), nullptr, false, i, searched_files, results);
EXPECT_EQ(i, num_limited_results);
EXPECT_EQ(num_limited_results, results.GetSize());
}
}
示例2: callbackBlock
void
SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list ) const
{
Block * curr_block = block;
bool isInlinedblock = false;
if (curr_block != nullptr && curr_block->GetContainingInlinedBlock() != nullptr)
isInlinedblock = true;
while (curr_block != nullptr && !isInlinedblock)
{
TypeMoveMatchingBlock callbackBlock (curr_block, type_map, type_list);
type_map.ForEach(callbackBlock);
curr_block = curr_block->GetParent();
}
if(function != nullptr && type_map.GetSize() > 0)
{
TypeMoveMatchingFunction callbackFunction (function, type_map, type_list);
type_map.ForEach(callbackFunction);
}
if(comp_unit != nullptr && type_map.GetSize() > 0)
{
TypeMoveMatchingCompileUnit callbackCompileUnit (comp_unit, type_map, type_list);
type_map.ForEach(callbackCompileUnit);
}
if(module_sp && type_map.GetSize() > 0)
{
TypeMoveMatchingModule callbackModule (module_sp, type_map, type_list);
type_map.ForEach(callbackModule);
}
if(type_map.GetSize() > 0)
{
TypeMaptoList callbackM2L (type_map, type_list);
type_map.ForEach(callbackM2L);
}
return ;
}