1 //===-- ExpressionOpts.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 31 // RenderScript-specific fixes for expression evaluation. 32 // In particular this is used to make expression IR conformant with the ABI 33 // generated by the slang frontend. This 34 // ModulePass is executed in ClangExpressionParser::PrepareForExecution whenever 35 // an expression's DWARF language is 36 // eLanguageTypeExtRenderscript 37 38 class RenderScriptRuntimeModulePass : public llvm::ModulePass { 39 public: 40 static char ID; 41 RenderScriptRuntimeModulePass(const lldb_private::Process *process) 42 : ModulePass(ID), m_process_ptr(process) {} 43 44 bool runOnModule(llvm::Module &module); 45 46 private: 47 const lldb_private::Process *m_process_ptr; 48 }; 49 50 namespace lldb_private { 51 namespace lldb_renderscript { 52 struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses { 53 RSIRPasses(lldb_private::Process *process); 54 55 ~RSIRPasses(); 56 }; 57 } // namespace lldb_renderscript 58 } // namespace lldb_private 59 #endif 60