retdec
|
Support for implementing the getSymbolicNamesForParam semantics. More...
#include <map>
#include <optional>
#include <unordered_map>
#include "retdec/llvmir2hll/support/types.h"
Go to the source code of this file.
Namespaces | |
retdec | |
retdec::llvmir2hll | |
retdec::llvmir2hll::semantics | |
Implementation of semantics. | |
Macros | |
#define | DEFINE_GET_SYMBOLIC_NAMES_FUNC_BEGIN(funcName) |
Starts a definition of a getSymbolicNamesFor() function. More... | |
#define | DEFINE_GET_SYMBOLIC_NAMES_FUNC_END() |
The ending part of DEFINE_GET_SYMBOLIC_NAMES_FUNC_BEGIN. More... | |
Typedefs | |
using | retdec::llvmir2hll::semantics::ParamSymbolsMap = std::map< unsigned, IntStringMap > |
Mapping of a parameter position into symbolic names of its possible values. More... | |
using | retdec::llvmir2hll::semantics::FuncParamsMap = std::unordered_map< std::string, ParamSymbolsMap > |
Mapping of a function name into ParamSymbolsMap. More... | |
Functions | |
std::optional< IntStringMap > | retdec::llvmir2hll::semantics::getSymbolicNamesForParamFromMap (const std::string &funcName, unsigned paramPos, const FuncParamsMap &map) |
Returns symbolic names for the given parameter from the given map. More... | |
Support for implementing the getSymbolicNamesForParam semantics.
#define DEFINE_GET_SYMBOLIC_NAMES_FUNC_BEGIN | ( | funcName | ) |
Starts a definition of a getSymbolicNamesFor() function.
Such a function can be used to provide the creation of symbolicNamesMap
for a specific set of names, like signal numbers or error numbers. In this way, the names can be aggregated on a single place and not copy&pasted to every place they are needed (error()
, error_at_line()
, etc).
The created function ensures that the map is filled at most once (upon the first call). Therefore, when you call the function for the second time, the already filled map is returned without filling the map again with the same data.
Every use of this macro has to be ended with DEFINE_GET_SYMBOLIC_NAMES_FUNC_END.
#define DEFINE_GET_SYMBOLIC_NAMES_FUNC_END | ( | ) |
The ending part of DEFINE_GET_SYMBOLIC_NAMES_FUNC_BEGIN.