TaggedASTType.h revision 979e20d127335143ffc89c2e37ec3a8b717ff22d
1//===-- TaggedASTType.h -----------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef liblldb_TaggedASTType_h_ 11#define liblldb_TaggedASTType_h_ 12 13#include "lldb/Symbol/ClangASTType.h" 14 15namespace lldb_private 16{ 17 18// For cases in which there are multiple classes of types that are not 19// interchangeable, to allow static type checking. 20template <unsigned int C> class TaggedASTType : public ClangASTType 21{ 22public: 23 TaggedASTType (lldb::clang_type_t type, clang::ASTContext *ast_context) : 24 ClangASTType(ast_context, type) { } 25 26 TaggedASTType (const TaggedASTType<C> &tw) : 27 ClangASTType(tw) { } 28 29 TaggedASTType () : 30 ClangASTType() { } 31 32 virtual ~TaggedASTType() { } 33 34 TaggedASTType<C> &operator= (const TaggedASTType<C> &tw) 35 { 36 ClangASTType::operator= (tw); 37 return *this; 38 } 39}; 40 41// Commonly-used tagged types, so code using them is interoperable 42typedef TaggedASTType<0> TypeFromParser; 43typedef TaggedASTType<1> TypeFromUser; 44 45} 46 47#endif 48