retdec
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
retdec::bin2llvmir::FileImageProvider Class Reference

#include <fileimage.h>

Collaboration diagram for retdec::bin2llvmir::FileImageProvider:
Collaboration graph
[legend]

Static Public Member Functions

static FileImageaddFileImage (llvm::Module *m, const std::string &path, Config *config)
 
static FileImageaddFileImage (llvm::Module *m, const std::shared_ptr< retdec::fileformat::FileFormat > &ff, Config *config)
 
static FileImagegetFileImage (llvm::Module *m)
 
static bool getFileImage (llvm::Module *m, FileImage *&img)
 
static void clear ()
 

Static Private Member Functions

static FileImageaddFileImage (llvm::Module *m, FileImage img)
 

Static Private Attributes

static std::map< llvm::Module *, FileImage_module2image
 Mapping of modules to file images associated with them. More...
 

Detailed Description

Completely static object – all members and methods are static -> it can be used by anywhere in bin2llvmirl. It provides mapping of modules to file images associated with them.

Attention
Even though this is accessible anywhere in bin2llvmirl, use it only in LLVM passes' prologs to initialize pass-local file image object. All analyses, utils and other modules MUST NOT use it. If they need to work with a file image, they should accept it in parameter.

Member Function Documentation

◆ addFileImage() [1/3]

FileImage * retdec::bin2llvmir::FileImageProvider::addFileImage ( llvm::Module *  m,
const std::shared_ptr< retdec::fileformat::FileFormat > &  ff,
Config config 
)
static

Create and add to provider a file image ff for the given module m and architecture a.

Returns
Created and added file image or nullptr if something went wrong and it was not successfully created.

◆ addFileImage() [2/3]

FileImage * retdec::bin2llvmir::FileImageProvider::addFileImage ( llvm::Module *  m,
const std::string &  path,
Config config 
)
static

Create and add to provider a file image created from file at path for the given module m and architecture a.

Returns
Created and added file image or nullptr if something went wrong and it was not successfully created.

◆ addFileImage() [3/3]

FileImage * retdec::bin2llvmir::FileImageProvider::addFileImage ( llvm::Module *  m,
FileImage  img 
)
staticprivate

◆ clear()

void retdec::bin2llvmir::FileImageProvider::clear ( )
static

Clear all stored data.

◆ getFileImage() [1/2]

FileImage * retdec::bin2llvmir::FileImageProvider::getFileImage ( llvm::Module *  m)
static
Returns
Get file image associated with the given module m or nullptr if there is no associated file image.

◆ getFileImage() [2/2]

bool retdec::bin2llvmir::FileImageProvider::getFileImage ( llvm::Module *  m,
FileImage *&  objf 
)
static

Get file image objf associated with the module m.

Parameters
[in]mModule for which to get file image.
[out]objfSet to file image associated with m module, or nullptr if there is no associated file image.
Returns
True if file image objf was set ok and can be used. False otherwise.

Member Data Documentation

◆ _module2image

std::map< llvm::Module *, FileImage > retdec::bin2llvmir::FileImageProvider::_module2image
staticprivate

Mapping of modules to file images associated with them.


The documentation for this class was generated from the following files: