retdec
Static Public Member Functions | List of all members
retdec::llvmir2hll::GlobalVarsSorter Class Reference

Sorts global variables according to the given conditions. More...

#include <global_vars_sorter.h>

Static Public Member Functions

static GlobalVarDefVector sortByInterdependencies (const GlobalVarDefVector &globalVars)
 Sorts the given vector of global variables by their interdependencies. More...
 

Detailed Description

Sorts global variables according to the given conditions.

This class implements the "static helper" (or "library") design pattern (it has just static functions and no instances can be created).

Member Function Documentation

◆ sortByInterdependencies()

GlobalVarDefVector retdec::llvmir2hll::GlobalVarsSorter::sortByInterdependencies ( const GlobalVarDefVector globalVars)
static

Sorts the given vector of global variables by their interdependencies.

For example, if it contains the following two global variables

int g = 5;

and

int *p = &g;

then they are ordered in this way because of their interdependencies.

Preconditions
  • the variables can be sorted in this way, i.e. there are no dependency loops that would prevent the variables from being sorted

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