blob: f45ff83c5a2bd9bc64f6dc33ae4ae2b8aef53067 [file] [log] [blame]
Alexander Shaposhnikov696bd632016-11-26 05:23:44 +00001//===-- RenderScriptExpressionOpts.h ----------------------------*- C++ -*-===//
Luke Drummond19459582016-07-28 14:21:07 +00002//
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
Kate Stoneb9c1b512016-09-06 20:57:50 +000029// RenderScriptRuntimeModulePass is a simple llvm::ModulesPass that is used
Luke Drummond80af0b92016-10-05 16:27:48 +000030// 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
Luke Drummond19459582016-07-28 14:21:07 +000035
Kate Stoneb9c1b512016-09-06 20:57:50 +000036class RenderScriptRuntimeModulePass : public llvm::ModulePass {
Luke Drummond19459582016-07-28 14:21:07 +000037public:
Kate Stoneb9c1b512016-09-06 20:57:50 +000038 static char ID;
39 RenderScriptRuntimeModulePass(const lldb_private::Process *process)
40 : ModulePass(ID), m_process_ptr(process) {}
Luke Drummond19459582016-07-28 14:21:07 +000041
Kate Stoneb9c1b512016-09-06 20:57:50 +000042 bool runOnModule(llvm::Module &module);
Luke Drummond19459582016-07-28 14:21:07 +000043
44private:
Kate Stoneb9c1b512016-09-06 20:57:50 +000045 const lldb_private::Process *m_process_ptr;
Luke Drummond19459582016-07-28 14:21:07 +000046};
47
Kate Stoneb9c1b512016-09-06 20:57:50 +000048namespace lldb_private {
49namespace lldb_renderscript {
50struct RSIRPasses : public lldb_private::LLVMUserExpression::IRPasses {
51 RSIRPasses(lldb_private::Process *process);
Luke Drummond19459582016-07-28 14:21:07 +000052
Kate Stoneb9c1b512016-09-06 20:57:50 +000053 ~RSIRPasses();
Luke Drummond19459582016-07-28 14:21:07 +000054};
55} // namespace lldb_renderscript
56} // namespace lldb_private
57#endif