Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Driver/Types.cpp
Show All 36 Lines | |||||
}; | }; | ||||
static constexpr TypeInfo TypeInfos[] = { | static constexpr TypeInfo TypeInfos[] = { | ||||
#define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, ...) \ | #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, ...) \ | ||||
{ NAME, TEMP_SUFFIX, TY_##PP_TYPE, { __VA_ARGS__ }, }, | { NAME, TEMP_SUFFIX, TY_##PP_TYPE, { __VA_ARGS__ }, }, | ||||
#include "clang/Driver/Types.def" | #include "clang/Driver/Types.def" | ||||
#undef TYPE | #undef TYPE | ||||
}; | }; | ||||
static const unsigned numTypes = llvm::array_lengthof(TypeInfos); | static const unsigned numTypes = std::size(TypeInfos); | ||||
static const TypeInfo &getInfo(unsigned id) { | static const TypeInfo &getInfo(unsigned id) { | ||||
assert(id > 0 && id - 1 < numTypes && "Invalid Type ID."); | assert(id > 0 && id - 1 < numTypes && "Invalid Type ID."); | ||||
return TypeInfos[id - 1]; | return TypeInfos[id - 1]; | ||||
} | } | ||||
const char *types::getTypeName(ID Id) { | const char *types::getTypeName(ID Id) { | ||||
return getInfo(Id).Name; | return getInfo(Id).Name; | ||||
▲ Show 20 Lines • Show All 372 Lines • Show Last 20 Lines |