1*696bd635SAlexander Shaposhnikov //===-- RenderScriptExpressionOpts.h ----------------------------*- C++ -*-===//
219459580SLuke Drummond //
319459580SLuke Drummond //                     The LLVM Compiler Infrastructure
419459580SLuke Drummond //
519459580SLuke Drummond // This file is distributed under the University of Illinois Open Source
619459580SLuke Drummond // License. See LICENSE.TXT for details.
719459580SLuke Drummond //
819459580SLuke Drummond //===----------------------------------------------------------------------===//
919459580SLuke Drummond 
1019459580SLuke Drummond #ifndef LLDB_RENDERSCRIPT_EXPROPTS_H
1119459580SLuke Drummond #define LLDB_RENDERSCRIPT_EXPROPTS_H
1219459580SLuke Drummond 
1319459580SLuke Drummond // C Includes
1419459580SLuke Drummond // C++ Includes
1519459580SLuke Drummond // Other libraries and framework includes
1619459580SLuke Drummond #include "llvm/IR/Module.h"
1719459580SLuke Drummond #include "llvm/Support/TargetRegistry.h"
1819459580SLuke Drummond #include "llvm/Target/TargetMachine.h"
1919459580SLuke Drummond #include "llvm/Target/TargetOptions.h"
2019459580SLuke Drummond 
2119459580SLuke Drummond // Project includes
2219459580SLuke Drummond #include "lldb/Target/LanguageRuntime.h"
2319459580SLuke Drummond #include "lldb/Target/Process.h"
2419459580SLuke Drummond #include "lldb/lldb-private.h"
2519459580SLuke Drummond 
2619459580SLuke Drummond #include "RenderScriptRuntime.h"
2719459580SLuke Drummond #include "RenderScriptx86ABIFixups.h"
2819459580SLuke Drummond 
29b9c1b51eSKate Stone // RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used
3080af0b9eSLuke Drummond // during expression evaluation to apply RenderScript-specific fixes for
3180af0b9eSLuke Drummond // expression evaluation. In particular this is used to make expression IR
3280af0b9eSLuke Drummond // conformant with the ABI generated by the slang frontend. This ModulePass is
3380af0b9eSLuke Drummond // executed in ClangExpressionParser::PrepareForExecution whenever an
3480af0b9eSLuke Drummond // expression's DWARF language is eLanguageTypeExtRenderscript
3519459580SLuke Drummond 
36b9c1b51eSKate Stone class RenderScriptRuntimeModulePass : public llvm::ModulePass {
3719459580SLuke Drummond public:
3819459580SLuke Drummond   static char ID;
39b9c1b51eSKate Stone   RenderScriptRuntimeModulePass(const lldb_private::Process *process)
40b9c1b51eSKate Stone       : ModulePass(ID), m_process_ptr(process) {}
4119459580SLuke Drummond 
42b9c1b51eSKate Stone   bool runOnModule(llvm::Module &module);
4319459580SLuke Drummond 
4419459580SLuke Drummond private:
4519459580SLuke Drummond   const lldb_private::Process *m_process_ptr;
4619459580SLuke Drummond };
4719459580SLuke Drummond 
48b9c1b51eSKate Stone namespace lldb_private {
49b9c1b51eSKate Stone namespace lldb_renderscript {
50b9c1b51eSKate Stone struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses {
5119459580SLuke Drummond   RSIRPasses(lldb_private::Process *process);
5219459580SLuke Drummond 
5319459580SLuke Drummond   ~RSIRPasses();
5419459580SLuke Drummond };
5519459580SLuke Drummond } // namespace lldb_renderscript
5619459580SLuke Drummond } // namespace lldb_private
5719459580SLuke Drummond #endif
58