retdec
|
Container for all C functions and types. More...
#include <context.h>
Public Member Functions | |
Access to functions. | |
bool | hasFunctionWithName (const std::string &name) const |
Checks if context contains function. More... | |
std::shared_ptr< Function > | getFunctionWithName (const std::string &name) const |
Returns function from context. More... | |
void | addFunction (const std::shared_ptr< Function > &function) |
Inserts new function to context. More... | |
Access to function types. | |
bool | hasFunctionType (const std::shared_ptr< Type > &returnType, const FunctionType::Parameters ¶meters, const CallConvention &callConvention, FunctionType::VarArgness varArgness) const |
Checks if context contains function type. More... | |
std::shared_ptr< FunctionType > | getFunctionType (const std::shared_ptr< Type > &returnType, const FunctionType::Parameters ¶meters, const CallConvention &callConvention, FunctionType::VarArgness varArgness) const |
Returns function type from context. More... | |
void | addFunctionType (const std::shared_ptr< FunctionType > &functionType) |
Inserts new function type to context. More... | |
Access to named types. | |
bool | hasNamedType (const std::string &name) const |
Checks if context contains type with specific name. More... | |
std::shared_ptr< Type > | getNamedType (const std::string &name) const |
Returns type with specific name from context. More... | |
void | addNamedType (const std::shared_ptr< Type > &type) |
Inserts new type with specific name to context. More... | |
Access to pointer types. | |
bool | hasPointerType (const std::shared_ptr< Type > &pointedType) const |
Checks if context contains pointer type. More... | |
std::shared_ptr< PointerType > | getPointerType (const std::shared_ptr< Type > &pointedType) const |
Returns pointerType from context. More... | |
void | addPointerType (const std::shared_ptr< PointerType > &pointerType) |
Inserts new pointerType with specific name to context. More... | |
Access to reference types. | |
bool | hasReferenceType (const std::shared_ptr< Type > &referencedType) const |
Checks if context contains reference type. More... | |
std::shared_ptr< ReferenceType > | getReferenceType (const std::shared_ptr< Type > &referencedType) const |
Returns referenceType from context. More... | |
void | addReferenceType (const std::shared_ptr< ReferenceType > &referenceType) |
Inserts new referenceType with specific name to context. More... | |
Access to array types. | |
bool | hasArrayType (const std::shared_ptr< Type > &elementType, const ArrayType::Dimensions &dimensions) const |
Checks if context contains array type. More... | |
std::shared_ptr< ArrayType > | getArrayType (const std::shared_ptr< Type > &elementType, const ArrayType::Dimensions &dimensions) const |
Returns array type from context. More... | |
void | addArrayType (const std::shared_ptr< ArrayType > &arrayType) |
Adds array type to context. More... | |
Access to annotations. | |
bool | hasAnnotation (const std::string &name) const |
Checks if context contains annotation. More... | |
std::shared_ptr< Annotation > | getAnnotation (const std::string &name) const |
Returns annotation from context. More... | |
void | addAnnotation (const std::shared_ptr< Annotation > &annot) |
Adds annotation to context. More... | |
Private Types | |
using | Functions = std::unordered_map< std::string, std::shared_ptr< Function > > |
using | FunctionTypes = std::map< std::tuple< std::shared_ptr< Type >, FunctionType::Parameters, std::string, bool >, std::shared_ptr< FunctionType > > |
using | NamedTypes = std::unordered_map< std::string, std::shared_ptr< Type > > |
using | PointerTypes = std::unordered_map< std::shared_ptr< Type >, std::shared_ptr< PointerType > > |
using | ReferenceTypes = std::unordered_map< std::shared_ptr< Type >, std::shared_ptr< ReferenceType > > |
using | ArrayTypes = std::map< std::pair< std::shared_ptr< Type >, ArrayType::Dimensions >, std::shared_ptr< ArrayType > > |
using | Annotations = std::unordered_map< std::string, std::shared_ptr< Annotation > > |
Private Attributes | |
Functions | functions |
Stored functions. More... | |
FunctionTypes | functionTypes |
Stored function types, key is return type and parameters' types. More... | |
NamedTypes | namedTypes |
Stored types that can be identified by name. More... | |
PointerTypes | pointerTypes |
Stored pointer types, key is type that they point to. More... | |
ReferenceTypes | referenceTypes |
Stored reference types, key is type that they reference. More... | |
ArrayTypes | arrayTypes |
Stored array types, key is element type and dimensions. More... | |
Annotations | annotations |
Stored annotations. More... | |
Container for all C functions and types.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
void retdec::ctypes::Context::addAnnotation | ( | const std::shared_ptr< Annotation > & | annot | ) |
Adds annotation to context.
void retdec::ctypes::Context::addArrayType | ( | const std::shared_ptr< ArrayType > & | arrayType | ) |
Adds array type to context.
void retdec::ctypes::Context::addFunction | ( | const std::shared_ptr< Function > & | function | ) |
Inserts new function to context.
Function with same name will be overwritten.
void retdec::ctypes::Context::addFunctionType | ( | const std::shared_ptr< FunctionType > & | functionType | ) |
Inserts new function type to context.
void retdec::ctypes::Context::addNamedType | ( | const std::shared_ptr< Type > & | type | ) |
Inserts new type with specific name to context.
void retdec::ctypes::Context::addPointerType | ( | const std::shared_ptr< PointerType > & | pointerType | ) |
Inserts new pointerType with specific name to context.
void retdec::ctypes::Context::addReferenceType | ( | const std::shared_ptr< ReferenceType > & | referenceType | ) |
Inserts new referenceType with specific name to context.
std::shared_ptr< Annotation > retdec::ctypes::Context::getAnnotation | ( | const std::string & | name | ) | const |
Returns annotation from context.
nullptr
. std::shared_ptr< ArrayType > retdec::ctypes::Context::getArrayType | ( | const std::shared_ptr< Type > & | elementType, |
const ArrayType::Dimensions & | dimensions | ||
) | const |
Returns array type from context.
nullptr
.std::shared_ptr< FunctionType > retdec::ctypes::Context::getFunctionType | ( | const std::shared_ptr< Type > & | returnType, |
const FunctionType::Parameters & | parameters, | ||
const CallConvention & | callConvention, | ||
FunctionType::VarArgness | varArgness | ||
) | const |
Returns function type from context.
nullptr
.std::shared_ptr< Function > retdec::ctypes::Context::getFunctionWithName | ( | const std::string & | name | ) | const |
Returns function from context.
nullptr
. std::shared_ptr< Type > retdec::ctypes::Context::getNamedType | ( | const std::string & | name | ) | const |
Returns type with specific name from context.
nullptr
. std::shared_ptr< PointerType > retdec::ctypes::Context::getPointerType | ( | const std::shared_ptr< Type > & | pointedType | ) | const |
Returns pointerType from context.
nullptr
.std::shared_ptr< ReferenceType > retdec::ctypes::Context::getReferenceType | ( | const std::shared_ptr< Type > & | referencedType | ) | const |
Returns referenceType from context.
nullptr
.bool retdec::ctypes::Context::hasAnnotation | ( | const std::string & | name | ) | const |
Checks if context contains annotation.
bool retdec::ctypes::Context::hasArrayType | ( | const std::shared_ptr< Type > & | elementType, |
const ArrayType::Dimensions & | dimensions | ||
) | const |
Checks if context contains array type.
bool retdec::ctypes::Context::hasFunctionType | ( | const std::shared_ptr< Type > & | returnType, |
const FunctionType::Parameters & | parameters, | ||
const CallConvention & | callConvention, | ||
FunctionType::VarArgness | varArgness | ||
) | const |
Checks if context contains function type.
bool retdec::ctypes::Context::hasFunctionWithName | ( | const std::string & | name | ) | const |
Checks if context contains function.
bool retdec::ctypes::Context::hasNamedType | ( | const std::string & | name | ) | const |
Checks if context contains type with specific name.
bool retdec::ctypes::Context::hasPointerType | ( | const std::shared_ptr< Type > & | pointedType | ) | const |
Checks if context contains pointer type.
bool retdec::ctypes::Context::hasReferenceType | ( | const std::shared_ptr< Type > & | referencedType | ) | const |
Checks if context contains reference type.
|
private |
Stored annotations.
|
private |
Stored array types, key is element type and dimensions.
|
private |
Stored functions.
|
private |
Stored function types, key is return type and parameters' types.
|
private |
Stored types that can be identified by name.
|
private |
Stored pointer types, key is type that they point to.
|
private |
Stored reference types, key is type that they reference.