1 //===-- TaggedASTType.h -----------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_SYMBOL_TAGGEDASTTYPE_H 10 #define LLDB_SYMBOL_TAGGEDASTTYPE_H 11 12 #include "lldb/Symbol/CompilerType.h" 13 14 namespace lldb_private { 15 16 // For cases in which there are multiple classes of types that are not 17 // interchangeable, to allow static type checking. 18 template <unsigned int C> class TaggedASTType : public CompilerType { 19 public: TaggedASTType(const CompilerType & compiler_type)20 TaggedASTType(const CompilerType &compiler_type) 21 : CompilerType(compiler_type) {} 22 TaggedASTType(lldb::opaque_compiler_type_t type,TypeSystem * type_system)23 TaggedASTType(lldb::opaque_compiler_type_t type, TypeSystem *type_system) 24 : CompilerType(type_system, type) {} 25 TaggedASTType(const TaggedASTType<C> & tw)26 TaggedASTType(const TaggedASTType<C> &tw) : CompilerType(tw) {} 27 TaggedASTType()28 TaggedASTType() : CompilerType() {} 29 ~TaggedASTType()30 virtual ~TaggedASTType() {} 31 32 TaggedASTType<C> &operator=(const TaggedASTType<C> &tw) { 33 CompilerType::operator=(tw); 34 return *this; 35 } 36 }; 37 38 // Commonly-used tagged types, so code using them is interoperable 39 typedef TaggedASTType<0> TypeFromParser; 40 typedef TaggedASTType<1> TypeFromUser; 41 } 42 43 #endif 44