Home | History | Annotate | Download | only in Symbol
      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 
     15 namespace 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.
     20 template <unsigned int C> class TaggedASTType : public ClangASTType
     21 {
     22 public:
     23     TaggedASTType (const ClangASTType &clang_type) :
     24         ClangASTType(clang_type)
     25     {
     26     }
     27 
     28     TaggedASTType (lldb::clang_type_t type, clang::ASTContext *ast_context) :
     29         ClangASTType(ast_context, type)
     30     {
     31     }
     32 
     33     TaggedASTType (const TaggedASTType<C> &tw) :
     34         ClangASTType(tw)
     35     {
     36     }
     37 
     38     TaggedASTType () :
     39         ClangASTType()
     40     {
     41     }
     42 
     43     virtual
     44     ~TaggedASTType()
     45     {
     46     }
     47 
     48     TaggedASTType<C> &operator= (const TaggedASTType<C> &tw)
     49     {
     50         ClangASTType::operator= (tw);
     51         return *this;
     52     }
     53 };
     54 
     55 // Commonly-used tagged types, so code using them is interoperable
     56 typedef TaggedASTType<0>    TypeFromParser;
     57 typedef TaggedASTType<1>    TypeFromUser;
     58 
     59 }
     60 
     61 #endif
     62