Zonr Chang | c383a50 | 2010-10-12 01:52:08 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2010, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Zonr Chang | 3a9ca1f | 2010-10-06 17:52:56 +0800 | [diff] [blame] | 17 | #ifndef _SLANG_COMPILER_SLANG_RS_HPP |
| 18 | #define _SLANG_COMPILER_SLANG_RS_HPP |
| 19 | |
| 20 | #include "slang.h" |
| 21 | |
| 22 | namespace slang { |
| 23 | class RSContext; |
| 24 | |
| 25 | class SlangRS : public Slang { |
| 26 | private: |
| 27 | // Context for RenderScript |
| 28 | RSContext *mRSContext; |
| 29 | |
| 30 | bool mAllowRSPrefix; |
| 31 | |
| 32 | protected: |
| 33 | virtual void initDiagnostic(); |
| 34 | virtual void initPreprocessor(); |
| 35 | virtual void initASTContext(); |
| 36 | |
| 37 | virtual clang::ASTConsumer |
| 38 | *createBackend(const clang::CodeGenOptions& CodeGenOpts, |
| 39 | llvm::raw_ostream *OS, |
| 40 | Slang::OutputType OT); |
| 41 | |
| 42 | |
| 43 | public: |
Zonr Chang | 592a954 | 2010-10-07 20:03:58 +0800 | [diff] [blame] | 44 | static bool IsRSHeaderFile(const char *File); |
| 45 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 46 | SlangRS(const std::string &Triple, const std::string &CPU, |
| 47 | const std::vector<std::string> &Features); |
Zonr Chang | 3a9ca1f | 2010-10-06 17:52:56 +0800 | [diff] [blame] | 48 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 49 | // The package name that's really applied will be filled in RealPackageName. |
| 50 | bool reflectToJava(const std::string &OutputPathBase, |
| 51 | const std::string &OutputPackageName, |
| 52 | std::string *RealPackageName); |
| 53 | |
| 54 | virtual void reset(); |
Zonr Chang | 3a9ca1f | 2010-10-06 17:52:56 +0800 | [diff] [blame] | 55 | |
| 56 | inline void allowRSPrefix(bool V = true) { mAllowRSPrefix = V; } |
| 57 | |
| 58 | virtual ~SlangRS(); |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | #endif // _SLANG_COMPILER_SLANG_RS_HPP |