1435933ddSDimitry Andric //===-- RenderScriptExpressionOpts.h ----------------------------*- C++ -*-===//
2435933ddSDimitry Andric //
3435933ddSDimitry Andric //                     The LLVM Compiler Infrastructure
4435933ddSDimitry Andric //
5435933ddSDimitry Andric // This file is distributed under the University of Illinois Open Source
6435933ddSDimitry Andric // License. See LICENSE.TXT for details.
7435933ddSDimitry Andric //
8435933ddSDimitry Andric //===----------------------------------------------------------------------===//
9435933ddSDimitry Andric 
10435933ddSDimitry Andric #ifndef LLDB_RENDERSCRIPT_EXPROPTS_H
11435933ddSDimitry Andric #define LLDB_RENDERSCRIPT_EXPROPTS_H
12435933ddSDimitry Andric 
13435933ddSDimitry Andric #include "llvm/IR/Module.h"
14435933ddSDimitry Andric #include "llvm/Support/TargetRegistry.h"
15435933ddSDimitry Andric #include "llvm/Target/TargetMachine.h"
16435933ddSDimitry Andric #include "llvm/Target/TargetOptions.h"
17435933ddSDimitry Andric 
18435933ddSDimitry Andric #include "lldb/Target/LanguageRuntime.h"
19435933ddSDimitry Andric #include "lldb/Target/Process.h"
20435933ddSDimitry Andric #include "lldb/lldb-private.h"
21435933ddSDimitry Andric 
22435933ddSDimitry Andric #include "RenderScriptRuntime.h"
23435933ddSDimitry Andric #include "RenderScriptx86ABIFixups.h"
24435933ddSDimitry Andric 
25435933ddSDimitry Andric // RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used
26435933ddSDimitry Andric // during expression evaluation to apply RenderScript-specific fixes for
27435933ddSDimitry Andric // expression evaluation. In particular this is used to make expression IR
28435933ddSDimitry Andric // conformant with the ABI generated by the slang frontend. This ModulePass is
29435933ddSDimitry Andric // executed in ClangExpressionParser::PrepareForExecution whenever an
30435933ddSDimitry Andric // expression's DWARF language is eLanguageTypeExtRenderscript
31435933ddSDimitry Andric 
32435933ddSDimitry Andric class RenderScriptRuntimeModulePass : public llvm::ModulePass {
33435933ddSDimitry Andric public:
34435933ddSDimitry Andric   static char ID;
RenderScriptRuntimeModulePass(const lldb_private::Process * process)35435933ddSDimitry Andric   RenderScriptRuntimeModulePass(const lldb_private::Process *process)
36435933ddSDimitry Andric       : ModulePass(ID), m_process_ptr(process) {}
37435933ddSDimitry Andric 
38435933ddSDimitry Andric   bool runOnModule(llvm::Module &module);
39435933ddSDimitry Andric 
40435933ddSDimitry Andric private:
41435933ddSDimitry Andric   const lldb_private::Process *m_process_ptr;
42435933ddSDimitry Andric };
43435933ddSDimitry Andric 
44435933ddSDimitry Andric namespace lldb_private {
45435933ddSDimitry Andric namespace lldb_renderscript {
46435933ddSDimitry Andric struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses {
47435933ddSDimitry Andric   RSIRPasses(lldb_private::Process *process);
48435933ddSDimitry Andric 
49435933ddSDimitry Andric   ~RSIRPasses();
50435933ddSDimitry Andric };
51435933ddSDimitry Andric } // namespace lldb_renderscript
52435933ddSDimitry Andric } // namespace lldb_private
53435933ddSDimitry Andric #endif
54