docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1#pragma once
2
3#include <llvm/IR/CFG.h>
4#include <llvm/IR/Constants.h>
5#include <llvm/IR/Instructions.h>
6#include <llvm/IR/Operator.h>
7
8#include <string>
9#include <utility>
10#include <vector>
11
13
15#include "docc/utils.h"
16
17namespace docc {
18namespace lifting {
19namespace utils {
20
21/**** New API ****/
22
23std::string get_name(const llvm::Value* value);
24
25std::string normalize_name(const std::string value);
26
27bool is_literal(const llvm::Value* value);
28
29bool is_null_pointer(const llvm::Value* value);
30
31bool is_symbol(const llvm::Value* value);
32
33std::string as_literal(const llvm::ConstantData* value);
34
35sdfg::symbolic::Expression as_symbol(const llvm::Constant* value);
36
37std::string get_initializer(const llvm::GlobalVariable& global);
38
39bool has_initializer(const llvm::GlobalVariable& global);
40
41std::string as_initializer(const llvm::Constant* initializer);
42
45 std::unordered_map<const llvm::Value*, std::string>& constants_mapping,
46 const llvm::Value* llvm_ptr
47);
48
50 std::unordered_map<const llvm::Value*, std::string>& constants_mapping, const llvm::Value* llvm_ptr
51);
52
53std::unique_ptr<sdfg::types::IType> get_type(
55 std::unordered_map<const llvm::Type*, std::string>& anonymous_types_mapping,
56 const llvm::DataLayout& DL,
57 llvm::Type* type,
58 sdfg::types::StorageType storage_type,
59 const std::string& initializer = ""
60);
61
63
64std::pair<std::string, sdfg::data_flow::Subset>
65get_memlet(std::unordered_map<const llvm::Value*, std::string>& constants_mapping, const llvm::GEPOperator* pointer);
66
67/**** Deprecated API ****/
68
69std::vector<llvm::GlobalVariable*> add_nested_global(const llvm::ConstantExpr* expr);
70
71} // namespace utils
72} // namespace lifting
73} // namespace docc
Definition sdfg_builder.h:13
Represents the storage location and management characteristics of data.
Definition type.h:64
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
Definition utils.h:19
bool is_literal(const llvm::Value *value)
std::vector< llvm::GlobalVariable * > add_nested_global(const llvm::ConstantExpr *expr)
sdfg::symbolic::Expression as_symbol(const llvm::Constant *value)
std::pair< std::string, sdfg::data_flow::Subset > get_memlet(std::unordered_map< const llvm::Value *, std::string > &constants_mapping, const llvm::GEPOperator *pointer)
std::string as_initializer(const llvm::Constant *initializer)
std::string as_literal(const llvm::ConstantData *value)
std::unique_ptr< sdfg::types::IType > get_type(sdfg::builder::SDFGBuilder &builder, std::unordered_map< const llvm::Type *, std::string > &anonymous_types_mapping, const llvm::DataLayout &DL, llvm::Type *type, sdfg::types::StorageType storage_type, const std::string &initializer="")
std::string get_initializer(const llvm::GlobalVariable &global)
bool is_null_pointer(const llvm::Value *value)
std::string get_name(const llvm::Value *value)
bool has_initializer(const llvm::GlobalVariable &global)
bool is_symbol(const llvm::Value *value)
std::string normalize_name(const std::string value)
std::string find_const_name_to_sdfg_name(std::unordered_map< const llvm::Value *, std::string > &constants_mapping, const llvm::Value *llvm_ptr)
sdfg::types::StorageType get_storage_type(sdfg::FunctionType target_type, size_t address_space)
std::string create_const_name_to_sdfg_name(sdfg::builder::SDFGBuilder &builder, std::unordered_map< const llvm::Value *, std::string > &constants_mapping, const llvm::Value *llvm_ptr)
Definition exceptions.h:9
Definition targets.h:8
StringEnum FunctionType
Definition function.h:37