retdec
semantics.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_SEMANTICS_SEMANTICS_H
8 #define RETDEC_LLVMIR2HLL_SEMANTICS_SEMANTICS_H
9 
10 #include <optional>
11 #include <string>
12 
15 
16 namespace retdec {
17 namespace llvmir2hll {
18 
34 public:
35  virtual ~Semantics() = default;
36 
40  virtual std::string getId() const = 0;
41 
45  virtual std::optional<std::string> getMainFuncName() const = 0;
46 
57  virtual std::optional<std::string> getCHeaderFileForFunc(
58  const std::string &funcName) const = 0;
59 
71  virtual std::optional<bool> funcNeverReturns(const std::string &funcName) const = 0;
72 
84  virtual std::optional<std::string> getNameOfVarStoringResult(
85  const std::string &funcName) const = 0;
86 
98  virtual std::optional<std::string> getNameOfParam(const std::string &funcName,
99  unsigned paramPos) const = 0;
100 
119  virtual std::optional<IntStringMap> getSymbolicNamesForParam(
120  const std::string &funcName, unsigned paramPos) const = 0;
121 
122 protected:
123  Semantics() = default;
124 };
125 
126 } // namespace llvmir2hll
127 } // namespace retdec
128 
129 #endif
A base class for all descriptions of function semantics.
Definition: semantics.h:33
virtual std::optional< IntStringMap > getSymbolicNamesForParam(const std::string &funcName, unsigned paramPos) const =0
Returns a mapping of integers into their symbolic names for the given parameter of the given function...
virtual std::optional< std::string > getNameOfVarStoringResult(const std::string &funcName) const =0
Returns an appropriate name of the variable that stores the result of calls to the given function.
virtual std::optional< std::string > getNameOfParam(const std::string &funcName, unsigned paramPos) const =0
Returns an appropriate name of the given function's parameter.
virtual std::optional< std::string > getMainFuncName() const =0
Returns the name of the main function.
virtual std::optional< std::string > getCHeaderFileForFunc(const std::string &funcName) const =0
Returns the C header file for the given function.
virtual std::string getId() const =0
Returns the ID of the semantics.
virtual std::optional< bool > funcNeverReturns(const std::string &funcName) const =0
Gets the information whether the given function never returns.
virtual ~Semantics()=default
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
A library providing API for working with back-end IR.
Definition: archive_wrapper.h:19
A mixin to make classes non-copyable.
Aliases for several useful types.