1 //===-- RenderScriptExpressionOpts.h ----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_RENDERSCRIPT_EXPROPTS_H
10 #define LLDB_RENDERSCRIPT_EXPROPTS_H
12 #include "llvm/IR/Module.h"
13 #include "llvm/Support/TargetRegistry.h"
14 #include "llvm/Target/TargetMachine.h"
15 #include "llvm/Target/TargetOptions.h"
17 #include "lldb/Target/LanguageRuntime.h"
18 #include "lldb/Target/Process.h"
19 #include "lldb/lldb-private.h"
21 #include "RenderScriptRuntime.h"
22 #include "RenderScriptx86ABIFixups.h"
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
31 class RenderScriptRuntimeModulePass : public llvm::ModulePass {
34 RenderScriptRuntimeModulePass(const lldb_private::Process *process)
35 : ModulePass(ID), m_process_ptr(process) {}
37 bool runOnModule(llvm::Module &module) override;
40 const lldb_private::Process *m_process_ptr;
43 namespace lldb_private {
44 namespace lldb_renderscript {
45 struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses {
46 RSIRPasses(lldb_private::Process *process);
50 } // namespace lldb_renderscript
51 } // namespace lldb_private