当前位置: 首页>>代码示例>>C++>>正文


C++ Type::GetForwardCompilerType方法代码示例

本文整理汇总了C++中Type::GetForwardCompilerType方法的典型用法代码示例。如果您正苦于以下问题:C++ Type::GetForwardCompilerType方法的具体用法?C++ Type::GetForwardCompilerType怎么用?C++ Type::GetForwardCompilerType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Type的用法示例。


在下文中一共展示了Type::GetForwardCompilerType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if


//.........这里部分代码省略.........
                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", dwarf->MakeUserID(die.GetOffset()),
                                 DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid);

                    switch (tag)
                    {
                        default:
                            break;

                        case DW_TAG_unspecified_type:
                            resolve_state = Type::eResolveStateFull;
                            compiler_type = m_ast.CreateVoidType(type_name_const_str);
                            break;

                        case DW_TAG_base_type:
                            resolve_state = Type::eResolveStateFull;
                            compiler_type = m_ast.CreateBaseType(go_kind, type_name_const_str, byte_size);
                            break;

                        case DW_TAG_pointer_type:
                            encoding_data_type = Type::eEncodingIsPointerUID;
                            break;
                        case DW_TAG_typedef:
                            encoding_data_type = Type::eEncodingIsTypedefUID;
                            CompilerType impl;
                            Type *type = dwarf->ResolveTypeUID(encoding_uid);
                            if (type)
                            {
                                if (go_kind == 0 && type->GetName() == type_name_const_str)
                                {
                                    // Go emits extra typedefs as a forward declaration. Ignore these.
                                    dwarf->m_die_to_type[die.GetDIE()] = type;
                                    return type->shared_from_this();
                                }
                                impl = type->GetForwardCompilerType();
                                compiler_type = m_ast.CreateTypedefType (go_kind, type_name_const_str, impl);
                            }
                            break;
                    }

                    type_sp.reset(new Type(dwarf->MakeUserID(die.GetOffset()), dwarf, type_name_const_str, byte_size,
                                           NULL, encoding_uid, encoding_data_type, &decl, compiler_type, resolve_state));

                    dwarf->m_die_to_type[die.GetDIE()] = type_sp.get();
                }
                break;

                case DW_TAG_structure_type:
                {
                    // Set a bit that lets us know that we are currently parsing this
                    dwarf->m_die_to_type[die.GetDIE()] = DIE_IS_BEING_PARSED;
                    bool byte_size_valid = false;

                    const size_t num_attributes = die.GetAttributes(attributes);
                    if (num_attributes > 0)
                    {
                        uint32_t i;
                        for (i = 0; i < num_attributes; ++i)
                        {
                            attr = attributes.AttributeAtIndex(i);
                            if (attributes.ExtractFormValueAtIndex(i, form_value))
                            {
                                switch (attr)
                                {
                                    case DW_AT_name:
                                        type_name_cstr = form_value.AsCString();
                                        type_name_const_str.SetCString(type_name_cstr);
开发者ID:32bitmicro,项目名称:riscv-lldb,代码行数:67,代码来源:DWARFASTParserGo.cpp

示例2: switch

size_t
DWARFASTParserGo::ParseChildParameters(const SymbolContext &sc,

                                       const DWARFDIE &parent_die, bool &is_variadic,
                                       std::vector<CompilerType> &function_param_types)
{
    if (!parent_die)
        return 0;

    size_t arg_idx = 0;
    for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid(); die = die.GetSibling())
    {

        dw_tag_t tag = die.Tag();
        switch (tag)
        {
            case DW_TAG_formal_parameter:
            {
                DWARFAttributes attributes;
                const size_t num_attributes = die.GetAttributes(attributes);
                if (num_attributes > 0)
                {
                    Declaration decl;
                    dw_offset_t param_type_die_offset = DW_INVALID_OFFSET;

                    uint32_t i;
                    for (i = 0; i < num_attributes; ++i)
                    {
                        const dw_attr_t attr = attributes.AttributeAtIndex(i);
                        DWARFFormValue form_value;
                        if (attributes.ExtractFormValueAtIndex(i, form_value))
                        {
                            switch (attr)
                            {
                                case DW_AT_name:
                                    // = form_value.AsCString();
                                    break;
                                case DW_AT_type:
                                    param_type_die_offset = form_value.Reference();
                                    break;
                                case DW_AT_location:
                                //                          if (form_value.BlockData())
                                //                          {
                                //                              const DWARFDataExtractor& debug_info_data =
                                //                              debug_info();
                                //                              uint32_t block_length = form_value.Unsigned();
                                //                              DWARFDataExtractor location(debug_info_data,
                                //                              form_value.BlockData() - debug_info_data.GetDataStart(),
                                //                              block_length);
                                //                          }
                                //                          else
                                //                          {
                                //                          }
                                //                          break;
                                default:
                                    break;
                            }
                        }
                    }

                    Type *type = parent_die.ResolveTypeUID(param_type_die_offset);
                    if (type)
                    {
                        function_param_types.push_back(type->GetForwardCompilerType());
                    }
                }
                arg_idx++;
            }
            break;

            case DW_TAG_unspecified_parameters:
                is_variadic = true;
                break;

            default:
                break;
        }
    }
    return arg_idx;
}
开发者ID:32bitmicro,项目名称:riscv-lldb,代码行数:80,代码来源:DWARFASTParserGo.cpp


注:本文中的Type::GetForwardCompilerType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。