1. Add comments to clarify (E.g., don't worry. "syntax error will be triggered by predecessor later")
2. Create ASTContext before RSContext creation and pass it to RSContext for using later
Change-Id: I6c11af70f1a13036c560aa34d311808548390864
diff --git a/slang.hpp b/slang.hpp
index 648678f..0dbf00c 100644
--- a/slang.hpp
+++ b/slang.hpp
@@ -101,14 +101,6 @@
return;
}
- /* Context of Slang compiler for RenderScript */
- llvm::OwningPtr<RSContext> mRSContext;
- inline void createRSContext() {
- mRSContext.reset(new RSContext(mPP.get(),
- mTarget.get()));
- return;
- }
-
/* The AST context (the context to hold long-lived AST nodes) */
llvm::OwningPtr<ASTContext> mASTContext;
inline void createASTContext() {
@@ -121,6 +113,15 @@
return;
}
+ /* Context for RenderScript */
+ llvm::OwningPtr<RSContext> mRSContext;
+ inline void createRSContext() {
+ mRSContext.reset(new RSContext(mPP.get(),
+ mASTContext.get(),
+ mTarget.get()));
+ return;
+ }
+
/* The AST consumer, responsible for code generation */
llvm::OwningPtr<Backend> mBackend;
inline void createBackend() {