Yang Ni | fb40ee2 | 2015-10-13 20:34:06 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015, 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 | |
| 17 | #ifndef _FRAMEWORKS_COMPILE_SLANG_RS_FOREACH_LOWERING_H |
| 18 | #define _FRAMEWORKS_COMPILE_SLANG_RS_FOREACH_LOWERING_H |
| 19 | |
| 20 | #include "clang/AST/StmtVisitor.h" |
| 21 | |
| 22 | namespace clang { |
| 23 | class ASTContext; |
| 24 | class CallExpr; |
| 25 | class Expr; |
| 26 | class FunctionDecl; |
| 27 | } |
| 28 | |
| 29 | namespace slang { |
| 30 | |
| 31 | class RSContext; |
| 32 | |
| 33 | class RSForEachLowering : public clang::StmtVisitor<RSForEachLowering> { |
| 34 | public: |
| 35 | RSForEachLowering(RSContext* ctxt); |
| 36 | |
| 37 | void VisitCallExpr(clang::CallExpr *CE); |
| 38 | void VisitStmt(clang::Stmt *S); |
| 39 | |
| 40 | private: |
| 41 | RSContext* mCtxt; |
| 42 | clang::ASTContext& mASTCtxt; |
| 43 | |
| 44 | const clang::FunctionDecl* matchFunctionDesignator(clang::Expr* expr); |
Yang Ni | 1946749 | 2015-10-27 15:24:41 -0700 | [diff] [blame^] | 45 | const clang::FunctionDecl* matchKernelLaunchCall(clang::CallExpr* CE, |
| 46 | int* slot, |
| 47 | bool* hasOptions); |
Yang Ni | fb40ee2 | 2015-10-13 20:34:06 +0000 | [diff] [blame] | 48 | clang::FunctionDecl* CreateForEachInternalFunctionDecl(); |
| 49 | clang::Expr* CreateCalleeExprForInternalForEach(); |
| 50 | }; // RSForEachLowering |
| 51 | |
| 52 | } // namespace slang |
| 53 | |
| 54 | #endif // _FRAMEWORKS_COMPILE_SLANG_RS_FOREACH_LOWERING_H |