IR: move UniqId to ir.tree module

This commit is contained in:
Georgy Bronnikov
2019-11-11 13:59:47 +03:00
parent 76016b1a3c
commit 1647279a8c
6 changed files with 19 additions and 9 deletions
@@ -0,0 +1,15 @@
package org.jetbrains.kotlin.ir.util
// This is an abstract uniqIdIndex any serialized IR declarations gets.
// It is either isLocal and then just gets and ordinary number within its module.
// Or is visible across modules and then gets a hash of mangled name as its index.
inline class UniqId(val index: Long) {
val isPublic: Boolean get() = (index and (1L shl 63)) != 0L
val isLocal: Boolean get() = (index and (1L shl 63)) == 0L
companion object {
val NONE = UniqId(0x7fffffffL)
}
}