libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
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
25namespace triton {
32 namespace ast {
40
42 private:
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 */
This is the main Triton Context class.
Definition context.hpp:45
Converts a LLVM IR to a Triton AST.
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.
TRITON_EXPORT LLVMToTriton(triton::Context &ctx)
Constructor.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition ast.hpp:59
std::shared_ptr< triton::ast::AstContext > SharedAstContext
Shared AST context.
Definition ast.hpp:65
std::uint32_t uint32
unisgned 32-bits
The Triton namespace.