1 //===-- RenderScriptExpressionOpts.h ----------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLDB_RENDERSCRIPT_EXPROPTS_H 11 #define LLDB_RENDERSCRIPT_EXPROPTS_H 12 13 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 #include "llvm/IR/Module.h" 17 #include "llvm/Support/TargetRegistry.h" 18 #include "llvm/Target/TargetMachine.h" 19 #include "llvm/Target/TargetOptions.h" 20 21 // Project includes 22 #include "lldb/Target/LanguageRuntime.h" 23 #include "lldb/Target/Process.h" 24 #include "lldb/lldb-private.h" 25 26 #include "RenderScriptRuntime.h" 27 #include "RenderScriptx86ABIFixups.h" 28 29 // RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used 30 // during expression evaluation to apply RenderScript-specific fixes for 31 // expression evaluation. In particular this is used to make expression IR 32 // conformant with the ABI generated by the slang frontend. This ModulePass is 33 // executed in ClangExpressionParser::PrepareForExecution whenever an 34 // expression's DWARF language is eLanguageTypeExtRenderscript 35 36 class RenderScriptRuntimeModulePass : public llvm::ModulePass { 37 public: 38 static char ID; 39 RenderScriptRuntimeModulePass(const lldb_private::Process *process) 40 : ModulePass(ID), m_process_ptr(process) {} 41 42 bool runOnModule(llvm::Module &module); 43 44 private: 45 const lldb_private::Process *m_process_ptr; 46 }; 47 48 namespace lldb_private { 49 namespace lldb_renderscript { 50 struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses { 51 RSIRPasses(lldb_private::Process *process); 52 53 ~RSIRPasses(); 54 }; 55 } // namespace lldb_renderscript 56 } // namespace lldb_private 57 #endif 58