aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h')
-rw-r--r--contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h b/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
index b9e2562bfc2b..bdc6cf46509b 100644
--- a/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
+++ b/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
@@ -116,13 +116,22 @@ public:
uint32_t toArrayIndex() const {
assert(!isSimple());
- return getIndex() - FirstNonSimpleIndex;
+ return (getIndex() & ~DecoratedItemIdMask) - FirstNonSimpleIndex;
}
static TypeIndex fromArrayIndex(uint32_t Index) {
return TypeIndex(Index + FirstNonSimpleIndex);
}
+ static TypeIndex fromDecoratedArrayIndex(bool IsItem, uint32_t Index) {
+ return TypeIndex((Index + FirstNonSimpleIndex) |
+ (IsItem ? DecoratedItemIdMask : 0));
+ }
+
+ TypeIndex removeDecoration() {
+ return TypeIndex(Index & ~DecoratedItemIdMask);
+ }
+
SimpleTypeKind getSimpleKind() const {
assert(isSimple());
return static_cast<SimpleTypeKind>(Index & SimpleKindMask);