1 /** 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef PANDA_TYPE_TAGS_H_ 17 #define PANDA_TYPE_TAGS_H_ 18 19 #include <cstdlib> 20 21 #include "verification/util/enum_tag.h" 22 #include "verification/util/int_tag.h" 23 24 #include "runtime/include/mem/panda_containers.h" 25 26 namespace panda::verifier { 27 using TypeNum = size_t; 28 using VectorNum = PandaVector<TypeNum>; 29 30 enum class TypeSystemKind { PANDA, JAVA }; 31 using TypeSystemKindTag = TagForEnum<TypeSystemKind, TypeSystemKind::PANDA, TypeSystemKind::JAVA>; 32 33 using ThreadNum = size_t; 34 constexpr size_t MAX_THREADS = 64; 35 using ThreadNumTag = TagForInt<ThreadNum, 0ULL, MAX_THREADS - 1ULL>; 36 37 enum class TypeVariance { INVARIANT, COVARIANT, CONTRVARIANT }; 38 using TypeVarianceTag = 39 TagForEnum<TypeVariance, TypeVariance::INVARIANT, TypeVariance::COVARIANT, TypeVariance::CONTRVARIANT>; 40 } // namespace panda::verifier 41 42 #endif // !PANDA_TYPE_TAGS_H_ 43