zonr | 6315f76 | 2010-10-05 15:35:14 +0800 | [diff] [blame] | 1 | #ifndef _SLANG_COMPILER_RS_EXPORT_VAR_H |
2 | #define _SLANG_COMPILER_RS_EXPORT_VAR_H | ||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 3 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 4 | #include "llvm/ADT/StringRef.h" |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 5 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 6 | #include "clang/AST/Decl.h" |
7 | #include "clang/AST/Expr.h" | ||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 8 | |
9 | #include <string> | ||||
10 | |||||
Shih-wei Liao | 324c047 | 2010-06-21 13:15:11 -0700 | [diff] [blame] | 11 | namespace clang { |
zonr | 6315f76 | 2010-10-05 15:35:14 +0800 | [diff] [blame] | 12 | class APValue; |
Shih-wei Liao | 324c047 | 2010-06-21 13:15:11 -0700 | [diff] [blame] | 13 | } |
14 | |||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 15 | namespace slang { |
16 | |||||
zonr | 6315f76 | 2010-10-05 15:35:14 +0800 | [diff] [blame] | 17 | class RSContext; |
18 | class RSExportType; | ||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 19 | |
20 | class RSExportVar { | ||||
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 21 | friend class RSContext; |
22 | private: | ||||
23 | RSContext *mContext; | ||||
24 | std::string mName; | ||||
25 | const RSExportType *mET; | ||||
26 | bool mIsConst; | ||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 27 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 28 | clang::Expr::EvalResult mInit; |
Shih-wei Liao | 324c047 | 2010-06-21 13:15:11 -0700 | [diff] [blame] | 29 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 30 | RSExportVar(RSContext *Context, |
31 | const clang::VarDecl *VD, | ||||
32 | const RSExportType *ET); | ||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 33 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 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; } | ||||
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 39 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 40 | inline const clang::APValue &getInit() const { return mInit.Val; } |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 41 | }; // RSExportVar |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 42 | |
Shih-wei Liao | 9ef2f78 | 2010-10-01 12:31:37 -0700 | [diff] [blame] | 43 | } // namespace slang |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 44 | |
zonr | 6315f76 | 2010-10-05 15:35:14 +0800 | [diff] [blame] | 45 | #endif // _SLANG_COMPILER_RS_EXPORT_VAR_H |