retdec
const_symbol_converter.h
Go to the documentation of this file.
1 /*
2 * @file include/retdec/llvmir2hll/support/const_symbol_converter.h
3 * @brief Converter of constants into their symbolic names.
4 * @copyright (c) 2017 Avast Software, licensed under the MIT license
5 */
6 
7 #ifndef RETDEC_LLVMIR2HLL_SUPPORT_CONST_SYMBOL_CONVERTER_H
8 #define RETDEC_LLVMIR2HLL_SUPPORT_CONST_SYMBOL_CONVERTER_H
9 
10 #include <string>
11 
16 
17 namespace retdec {
18 namespace llvmir2hll {
19 
20 class Module;
21 
32 public:
33  static void convert(ShPtr<Module> module);
34 
35 private:
37 
38  void performConversion();
40  const std::string &calledFuncName);
42  const IntStringMap &symbolicNamesMap);
43 
47  virtual void visit(ShPtr<CallExpr> expr) override;
49 
50 private:
53 };
54 
55 } // namespace llvmir2hll
56 } // namespace retdec
57 
58 #endif
Converter of constants into their symbolic names.
Definition: const_symbol_converter.h:31
ShPtr< Module > module
Module in which the constants are converted.
Definition: const_symbol_converter.h:52
ConstSymbolConverter(ShPtr< Module > module)
Constructs a new converter.
Definition: const_symbol_converter.cpp:74
static void convert(ShPtr< Module > module)
Converts the constants in function calls in the given module into expressions consisting of symbolic ...
Definition: const_symbol_converter.cpp:101
virtual void visit(ShPtr< GlobalVarDef > varDef) override
Definition: ordered_all_visitor.cpp:95
void performConversion()
Performs the conversion of constants into constant symbols.
Definition: const_symbol_converter.cpp:113
void convertArgsToSymbolicNames(ShPtr< CallExpr > callExpr, const std::string &calledFuncName)
Tries to convert arguments in the given call into expressions consisting of symbolic names.
Definition: const_symbol_converter.cpp:133
ShPtr< Expression > convertArgToSymbolicNames(ShPtr< ConstInt > arg, const IntStringMap &symbolicNamesMap)
Tries to convert the given argument into an expression consisting of symbolic names.
Definition: const_symbol_converter.cpp:174
A visitor that visits everything in an ordered way.
Definition: ordered_all_visitor.h:44
virtual void visit(ShPtr< GlobalVarDef > varDef) override
Definition: ordered_all_visitor.cpp:95
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
A representation of a complete module.
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
std::map< std::int64_t, std::string > IntStringMap
Mapping of a 64b int into a string.
Definition: types.h:135
Definition: archive_wrapper.h:19
A mixin to make classes non-copyable.
A visitor that visits everything in an ordered way.
Declarations, aliases, macros, etc. for the use of smart pointers.