1 //===-- RenderScriptExpressionOpts.h ----------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_RENDERSCRIPT_RENDERSCRIPTRUNTIME_RENDERSCRIPTEXPRESSIONOPTS_H 10 #define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_RENDERSCRIPT_RENDERSCRIPTRUNTIME_RENDERSCRIPTEXPRESSIONOPTS_H 11 12 #include "llvm/IR/Module.h" 13 #include "llvm/Support/TargetRegistry.h" 14 #include "llvm/Target/TargetMachine.h" 15 #include "llvm/Target/TargetOptions.h" 16 17 #include "lldb/Target/LanguageRuntime.h" 18 #include "lldb/Target/Process.h" 19 #include "lldb/lldb-private.h" 20 21 #include "RenderScriptRuntime.h" 22 #include "RenderScriptx86ABIFixups.h" 23 24 // RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used 25 // during expression evaluation to apply RenderScript-specific fixes for 26 // expression evaluation. In particular this is used to make expression IR 27 // conformant with the ABI generated by the slang frontend. This ModulePass is 28 // executed in ClangExpressionParser::PrepareForExecution whenever an 29 // expression's DWARF language is eLanguageTypeExtRenderscript 30 31 class RenderScriptRuntimeModulePass : public llvm::ModulePass { 32 public: 33 static char ID; RenderScriptRuntimeModulePass(const lldb_private::Process * process)34 RenderScriptRuntimeModulePass(const lldb_private::Process *process) 35 : ModulePass(ID), m_process_ptr(process) {} 36 37 bool runOnModule(llvm::Module &module) override; 38 39 private: 40 const lldb_private::Process *m_process_ptr; 41 }; 42 43 namespace lldb_private { 44 namespace lldb_renderscript { 45 struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses { 46 RSIRPasses(lldb_private::Process *process); 47 48 ~RSIRPasses(); 49 }; 50 } // namespace lldb_renderscript 51 } // namespace lldb_private 52 #endif 53