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