retdec
default_semantics.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_SEMANTICS_SEMANTICS_DEFAULT_SEMANTICS_H
8 #define RETDEC_LLVMIR2HLL_SEMANTICS_SEMANTICS_DEFAULT_SEMANTICS_H
9 
10 #include <optional>
11 #include <string>
12 
15 
16 namespace retdec {
17 namespace llvmir2hll {
18 
28 class DefaultSemantics: public Semantics {
29 public:
30  static ShPtr<Semantics> create();
31 
34  virtual std::string getId() const override;
35  virtual std::optional<std::string> getMainFuncName() const override;
36  virtual std::optional<std::string> getCHeaderFileForFunc(
37  const std::string &funcName) const override;
38  virtual std::optional<bool> funcNeverReturns(
39  const std::string &funcName) const override;
40  virtual std::optional<std::string> getNameOfVarStoringResult(
41  const std::string &funcName) const override;
42  virtual std::optional<std::string> getNameOfParam(const std::string &funcName,
43  unsigned paramPos) const override;
44  virtual std::optional<IntStringMap> getSymbolicNamesForParam(
45  const std::string &funcName, unsigned paramPos) const override;
47 
48 protected:
50 };
51 
52 } // namespace llvmir2hll
53 } // namespace retdec
54 
55 #endif
A default semantics which doesn't know anything.
Definition: default_semantics.h:28
virtual std::optional< std::string > getNameOfParam(const std::string &funcName, unsigned paramPos) const override
Returns an appropriate name of the given function's parameter.
Definition: default_semantics.cpp:52
virtual std::string getId() const override
Returns the ID of the semantics.
Definition: default_semantics.cpp:29
virtual std::optional< std::string > getNameOfVarStoringResult(const std::string &funcName) const override
Returns an appropriate name of the variable that stores the result of calls to the given function.
Definition: default_semantics.cpp:47
virtual std::optional< std::string > getMainFuncName() const override
Returns the name of the main function.
Definition: default_semantics.cpp:33
virtual std::optional< IntStringMap > getSymbolicNamesForParam(const std::string &funcName, unsigned paramPos) const override
Returns a mapping of integers into their symbolic names for the given parameter of the given function...
Definition: default_semantics.cpp:57
static ShPtr< Semantics > create()
Creates a new semantics.
Definition: default_semantics.cpp:25
virtual std::optional< bool > funcNeverReturns(const std::string &funcName) const override
Gets the information whether the given function never returns.
Definition: default_semantics.cpp:42
virtual std::optional< std::string > getCHeaderFileForFunc(const std::string &funcName) const override
Returns the C header file for the given function.
Definition: default_semantics.cpp:37
DefaultSemantics()
Constructs the semantics.
Definition: default_semantics.cpp:20
A base class for all descriptions of function semantics.
Definition: semantics.h:33
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
Definition: archive_wrapper.h:19
A base class for all descriptions of function semantics.
Declarations, aliases, macros, etc. for the use of smart pointers.