libTriton
version 1.0 build 1592
Loading...
Searching...
No Matches
src
libtriton
includes
triton
llvmToTriton.hpp
Go to the documentation of this file.
1
2
/*
3
** Copyright (C) - Triton
4
**
5
** This program is under the terms of the Apache License 2.0.
6
*/
7
//
8
9
#ifndef TRITON_LLVMTOTRITON_HPP
10
#define TRITON_LLVMTOTRITON_HPP
11
12
#include <map>
13
#include <memory>
14
#include <string>
15
16
#include <
triton/context.hpp
>
17
18
#include <llvm/IR/IRBuilder.h>
19
#include <llvm/IR/LLVMContext.h>
20
#include <llvm/IR/Module.h>
21
22
23
25
namespace
triton
{
32
namespace
ast {
40
41
class
LLVMToTriton
{
42
private
:
44
triton::ast::SharedAstContext
actx;
45
47
triton::Context
* ctx;
48
50
std::map<std::string, SharedAbstractNode> symvars;
51
53
triton::ast::SharedAbstractNode
do_convert(llvm::Value* llvmnode);
54
56
triton::ast::SharedAbstractNode
var(
const
std::string& name,
triton::uint32
varSize);
57
58
public
:
60
TRITON_EXPORT
LLVMToTriton
(
triton::Context
& ctx);
61
63
TRITON_EXPORT
LLVMToTriton
(
const
triton::ast::SharedAstContext
& actx);
64
66
TRITON_EXPORT
triton::ast::SharedAbstractNode
convert
(llvm::Module* llvmModule,
const
char
* fname=
"__triton"
);
67
69
TRITON_EXPORT
triton::ast::SharedAbstractNode
convert
(llvm::Value* instruction);
70
};
71
73
};
75
};
76
77
#endif
/* TRITON_LLVMTOTRITON_HPP */
triton::Context
This is the main Triton Context class.
Definition
context.hpp:45
triton::ast::LLVMToTriton
Converts a LLVM IR to a Triton AST.
Definition
llvmToTriton.hpp:41
triton::ast::LLVMToTriton::convert
TRITON_EXPORT triton::ast::SharedAbstractNode convert(llvm::Module *llvmModule, const char *fname="__triton")
Converts a given function from an LLVM module to a Triton AST.
Definition
llvmToTriton.cpp:266
triton::ast::LLVMToTriton::LLVMToTriton
TRITON_EXPORT LLVMToTriton(triton::Context &ctx)
Constructor.
Definition
llvmToTriton.cpp:15
context.hpp
triton::ast::SharedAbstractNode
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition
ast.hpp:59
triton::ast::SharedAstContext
std::shared_ptr< triton::ast::AstContext > SharedAstContext
Shared AST context.
Definition
ast.hpp:65
triton::uint32
std::uint32_t uint32
unisgned 32-bits
Definition
tritonTypes.hpp:39
triton
The Triton namespace.
Definition
architecture.cpp:27
Generated by
1.10.0