本文整理汇总了C++中TypeIndex::getSimpleKind方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeIndex::getSimpleKind方法的具体用法?C++ TypeIndex::getSimpleKind怎么用?C++ TypeIndex::getSimpleKind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeIndex
的用法示例。
在下文中一共展示了TypeIndex::getSimpleKind方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTypeName
StringRef CVTypeDumper::getTypeName(TypeIndex TI) {
if (TI.isNoType())
return "<no type>";
if (TI.isSimple()) {
// This is a simple type.
for (const auto &SimpleTypeName : SimpleTypeNames) {
if (SimpleTypeName.Value == TI.getSimpleKind()) {
if (TI.getSimpleMode() == SimpleTypeMode::Direct)
return SimpleTypeName.Name.drop_back(1);
// Otherwise, this is a pointer type. We gloss over the distinction
// between near, far, 64, 32, etc, and just give a pointer type.
return SimpleTypeName.Name;
}
}
return "<unknown simple type>";
}
// User-defined type.
StringRef UDTName;
unsigned UDTIndex = TI.getIndex() - 0x1000;
if (UDTIndex < CVUDTNames.size())
return CVUDTNames[UDTIndex];
return "<unknown UDT>";
}
示例2: GetIntegralTypeInfo
static std::pair<size_t, bool> GetIntegralTypeInfo(TypeIndex ti,
TpiStream &tpi) {
if (ti.isSimple()) {
SimpleTypeKind stk = ti.getSimpleKind();
return {GetTypeSizeForSimpleKind(stk), IsSimpleTypeSignedInteger(stk)};
}
CVType cvt = tpi.getType(ti);
switch (cvt.kind()) {
case LF_MODIFIER: {
ModifierRecord mfr;
llvm::cantFail(TypeDeserializer::deserializeAs<ModifierRecord>(cvt, mfr));
return GetIntegralTypeInfo(mfr.ModifiedType, tpi);
}
case LF_POINTER: {
PointerRecord pr;
llvm::cantFail(TypeDeserializer::deserializeAs<PointerRecord>(cvt, pr));
return GetIntegralTypeInfo(pr.ReferentType, tpi);
}
case LF_ENUM: {
EnumRecord er;
llvm::cantFail(TypeDeserializer::deserializeAs<EnumRecord>(cvt, er));
return GetIntegralTypeInfo(er.UnderlyingType, tpi);
}
default:
assert(false && "Type is not integral!");
return {0, false};
}
}
示例3: createSimpleType
SymIndexId SymbolCache::createSimpleType(TypeIndex Index,
ModifierOptions Mods) {
if (Index.getSimpleMode() != codeview::SimpleTypeMode::Direct)
return createSymbol<NativeTypePointer>(Index);
const auto Kind = Index.getSimpleKind();
const auto It = std::find_if(
std::begin(BuiltinTypes), std::end(BuiltinTypes),
[Kind](const BuiltinTypeEntry &Builtin) { return Builtin.Kind == Kind; });
if (It == std::end(BuiltinTypes))
return 0;
return createSymbol<NativeTypeBuiltin>(Mods, It->Type, It->Size);
}
示例4: simpleTypeName
StringRef TypeIndex::simpleTypeName(TypeIndex TI) {
assert(TI.isNoneType() || TI.isSimple());
if (TI.isNoneType())
return "<no type>";
if (TI == TypeIndex::NullptrT())
return "std::nullptr_t";
// This is a simple type.
for (const auto &SimpleTypeName : SimpleTypeNames) {
if (SimpleTypeName.Kind == TI.getSimpleKind()) {
if (TI.getSimpleMode() == SimpleTypeMode::Direct)
return SimpleTypeName.Name.drop_back(1);
// Otherwise, this is a pointer type. We gloss over the distinction
// between near, far, 64, 32, etc, and just give a pointer type.
return SimpleTypeName.Name;
}
}
return "<unknown simple type>";
}
示例5: getTypeName
StringRef TypeDatabase::getTypeName(TypeIndex Index) const {
if (Index.isNoneType())
return "<no type>";
if (Index.isSimple()) {
// This is a simple type.
for (const auto &SimpleTypeName : SimpleTypeNames) {
if (SimpleTypeName.Kind == Index.getSimpleKind()) {
if (Index.getSimpleMode() == SimpleTypeMode::Direct)
return SimpleTypeName.Name.drop_back(1);
// Otherwise, this is a pointer type. We gloss over the distinction
// between near, far, 64, 32, etc, and just give a pointer type.
return SimpleTypeName.Name;
}
}
return "<unknown simple type>";
}
uint32_t I = Index.getIndex() - TypeIndex::FirstNonSimpleIndex;
if (I < CVUDTNames.size())
return CVUDTNames[I];
return "<unknown UDT>";
}