slang_rs_foreach_lowering.h revision 45aa8c52c9400cef86efe4343f04e605a66f42af
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 22namespace clang { 23 class ASTContext; 24 class CallExpr; 25 class Expr; 26 class FunctionDecl; 27} 28 29namespace slang { 30 31class RSContext; 32 33class 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); 45 const clang::FunctionDecl* matchKernelLaunchCall(clang::CallExpr* CE); 46 clang::FunctionDecl* CreateForEachInternalFunctionDecl(); 47 clang::Expr* CreateCalleeExprForInternalForEach(); 48}; // RSForEachLowering 49 50} // namespace slang 51 52#endif // _FRAMEWORKS_COMPILE_SLANG_RS_FOREACH_LOWERING_H 53