blob: a8da424d61369894c531572c488f9d57214cfdab [file] [log] [blame]
Zonr Changc383a502010-10-12 01:52:08 +08001/*
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 Chang3a9ca1f2010-10-06 17:52:56 +080017#ifndef _SLANG_COMPILER_SLANG_RS_HPP
18#define _SLANG_COMPILER_SLANG_RS_HPP
19
20#include "slang.h"
21
22namespace slang {
23 class RSContext;
24
25class 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 Chang592a9542010-10-07 20:03:58 +080044 static bool IsRSHeaderFile(const char *File);
45
Shih-wei Liaob81c6a42010-10-10 14:15:00 -070046 SlangRS(const std::string &Triple, const std::string &CPU,
47 const std::vector<std::string> &Features);
Zonr Chang3a9ca1f2010-10-06 17:52:56 +080048
Shih-wei Liaob81c6a42010-10-10 14:15:00 -070049 // 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 Chang3a9ca1f2010-10-06 17:52:56 +080055
56 inline void allowRSPrefix(bool V = true) { mAllowRSPrefix = V; }
57
58 virtual ~SlangRS();
59};
60}
61
62#endif // _SLANG_COMPILER_SLANG_RS_HPP