blob: 2e3073322ce4c938999df07d6a068d6f394e5869 [file] [log] [blame]
Yang Nifb40ee22015-10-13 20:34:06 +00001/*
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);
Yang Ni19467492015-10-27 15:24:41 -070045 const clang::FunctionDecl* matchKernelLaunchCall(clang::CallExpr* CE,
46 int* slot,
47 bool* hasOptions);
Yang Nifb40ee22015-10-13 20:34:06 +000048 clang::FunctionDecl* CreateForEachInternalFunctionDecl();
49 clang::Expr* CreateCalleeExprForInternalForEach();
50}; // RSForEachLowering
51
52} // namespace slang
53
54#endif // _FRAMEWORKS_COMPILE_SLANG_RS_FOREACH_LOWERING_H