119459580SLuke Drummond //===-- ExpressionOpts.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 29*b9c1b51eSKate Stone // RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used 30*b9c1b51eSKate Stone // during expression evaluation to apply 3119459580SLuke Drummond // RenderScript-specific fixes for expression evaluation. 32*b9c1b51eSKate Stone // In particular this is used to make expression IR conformant with the ABI 33*b9c1b51eSKate Stone // generated by the slang frontend. This 34*b9c1b51eSKate Stone // ModulePass is executed in ClangExpressionParser::PrepareForExecution whenever 35*b9c1b51eSKate Stone // an expression's DWARF language is 3619459580SLuke Drummond // eLanguageTypeExtRenderscript 3719459580SLuke Drummond 38*b9c1b51eSKate Stone class RenderScriptRuntimeModulePass : public llvm::ModulePass { 3919459580SLuke Drummond public: 4019459580SLuke Drummond static char ID; 41*b9c1b51eSKate Stone RenderScriptRuntimeModulePass(const lldb_private::Process *process) 42*b9c1b51eSKate Stone : ModulePass(ID), m_process_ptr(process) {} 4319459580SLuke Drummond 44*b9c1b51eSKate Stone bool runOnModule(llvm::Module &module); 4519459580SLuke Drummond 4619459580SLuke Drummond private: 4719459580SLuke Drummond const lldb_private::Process *m_process_ptr; 4819459580SLuke Drummond }; 4919459580SLuke Drummond 50*b9c1b51eSKate Stone namespace lldb_private { 51*b9c1b51eSKate Stone namespace lldb_renderscript { 52*b9c1b51eSKate Stone struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses { 5319459580SLuke Drummond RSIRPasses(lldb_private::Process *process); 5419459580SLuke Drummond 5519459580SLuke Drummond ~RSIRPasses(); 5619459580SLuke Drummond }; 5719459580SLuke Drummond } // namespace lldb_renderscript 5819459580SLuke Drummond } // namespace lldb_private 5919459580SLuke Drummond #endif 60