本文整理汇总了C++中CompilerType::GetTypeName方法的典型用法代码示例。如果您正苦于以下问题:C++ CompilerType::GetTypeName方法的具体用法?C++ CompilerType::GetTypeName怎么用?C++ CompilerType::GetTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompilerType
的用法示例。
在下文中一共展示了CompilerType::GetTypeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTypeBitSize
bool ObjCLanguageRuntime::GetTypeBitSize(const CompilerType &compiler_type,
uint64_t &size) {
void *opaque_ptr = compiler_type.GetOpaqueQualType();
size = m_type_size_cache.Lookup(opaque_ptr);
// an ObjC object will at least have an ISA, so 0 is definitely not OK
if (size > 0)
return true;
ClassDescriptorSP class_descriptor_sp =
GetClassDescriptorFromClassName(compiler_type.GetTypeName());
if (!class_descriptor_sp)
return false;
int32_t max_offset = INT32_MIN;
uint64_t sizeof_max = 0;
bool found = false;
for (size_t idx = 0; idx < class_descriptor_sp->GetNumIVars(); idx++) {
const auto &ivar = class_descriptor_sp->GetIVarAtIndex(idx);
int32_t cur_offset = ivar.m_offset;
if (cur_offset > max_offset) {
max_offset = cur_offset;
sizeof_max = ivar.m_size;
found = true;
}
}
size = 8 * (max_offset + sizeof_max);
if (found)
m_type_size_cache.Insert(opaque_ptr, size);
return found;
}
示例2: JavaReferenceType
CompilerType
JavaASTContext::CreateReferenceType(const CompilerType &pointee_type) {
ConstString name = pointee_type.GetTypeName();
auto it = m_reference_type_map.find(name);
if (it == m_reference_type_map.end())
it = m_reference_type_map
.emplace(name, std::unique_ptr<JavaType>(
new JavaReferenceType(pointee_type)))
.first;
return CompilerType(this, it->second.get());
}
示例3: CreateArrayType
CompilerType JavaASTContext::CreateArrayType(
const ConstString &linkage_name, const CompilerType &element_type,
const DWARFExpression &length_expression, const lldb::addr_t data_offset) {
ConstString name = element_type.GetTypeName();
auto it = m_array_type_map.find(name);
if (it == m_array_type_map.end()) {
std::unique_ptr<JavaType> array_type(new JavaArrayType(
linkage_name, element_type, length_expression, data_offset));
it = m_array_type_map.emplace(name, std::move(array_type)).first;
}
return CompilerType(this, it->second.get());
}