slang_rs_export_var.h revision 324c0479ec3edda573de60b2e6476507a99d06f7
1#ifndef _SLANG_COMPILER_RS_EXPORT_VAR_HPP 2# define _SLANG_COMPILER_RS_EXPORT_VAR_HPP 3 4#include "llvm/ADT/StringRef.h" /* for class llvm::StringRef */ 5 6#include "clang/AST/Decl.h" /* for clang::VarDecl */ 7#include "clang/AST/Expr.h" /* for clang::Expr */ 8 9#include <string> 10 11namespace clang { 12 class APValue; 13} 14 15namespace slang { 16 17using namespace clang; 18 19class RSContext; 20class RSExportType; 21 22class RSExportVar { 23 friend class RSContext; 24private: 25 RSContext* mContext; 26 std::string mName; 27 const RSExportType* mET; 28 29 Expr::EvalResult mInit; 30 31 RSExportVar(RSContext* Context, const VarDecl* VD, const RSExportType* ET); 32 33public: 34 inline const std::string& getName() const { return mName; } 35 inline const RSExportType* getType() const { return mET; } 36 inline RSContext* getRSContext() const { return mContext; } 37 38 inline const APValue& getInit() const { return mInit.Val; } 39 40}; /* RSExportVar */ 41 42 43} /* namespace slang */ 44 45#endif /* _SLANG_COMPILER_RS_EXPORT_VAR_HPP */ 46