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/MC/TargetRegistry.h" 14 #include "llvm/Pass.h" 15 #include "llvm/Target/TargetMachine.h" 16 #include "llvm/Target/TargetOptions.h" 17 18 #include "lldb/Target/LanguageRuntime.h" 19 #include "lldb/Target/Process.h" 20 #include "lldb/lldb-private.h" 21 22 #include "RenderScriptRuntime.h" 23 #include "RenderScriptx86ABIFixups.h" 24 25 // RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used 26 // during expression evaluation to apply RenderScript-specific fixes for 27 // expression evaluation. In particular this is used to make expression IR 28 // conformant with the ABI generated by the slang frontend. This ModulePass is 29 // executed in ClangExpressionParser::PrepareForExecution whenever an 30 // expression's DWARF language is eLanguageTypeExtRenderscript 31 32 class RenderScriptRuntimeModulePass : public llvm::ModulePass { 33 public: 34 static char ID; RenderScriptRuntimeModulePass(const lldb_private::Process * process)35 RenderScriptRuntimeModulePass(const lldb_private::Process *process) 36 : ModulePass(ID), m_process_ptr(process) {} 37 38 bool runOnModule(llvm::Module &module) override; 39 40 private: 41 const lldb_private::Process *m_process_ptr; 42 }; 43 44 namespace lldb_private { 45 namespace lldb_renderscript { 46 struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses { 47 RSIRPasses(lldb_private::Process *process); 48 49 ~RSIRPasses(); 50 }; 51 } // namespace lldb_renderscript 52 } // namespace lldb_private 53 #endif 54