retdec
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
retdec::llvmir2hll Namespace Reference

Namespaces

 semantics
 Implementation of semantics.
 

Classes

class  BasicAliasAnalysis
 A basic alias analysis. More...
 
class  SimpleAliasAnalysis
 A very simple alias analysis. More...
 
class  AliasAnalysis
 A base class for all alias analyses. More...
 
class  BreakInIfAnalysis
 Analysis of a break statement in an if statement. More...
 
class  DefUseChains
 Def-use chains. More...
 
class  DefUseAnalysis
 An analysis providing def-use chains. More...
 
class  ExprTypesAnalysis
 A visitor for analyzing the types in BIR. More...
 
class  GotoTargetAnalysis
 Analysis of goto targets. More...
 
class  IndirectFuncRefAnalysis
 Analysis of functions that are referenced outside of direct calls. More...
 
class  NoInitVarDefAnalysis
 
class  NullPointerAnalysis
 Analysis of the use of null pointers. More...
 
class  SpecialFPAnalysis
 A visitor for obtaining information whether a special floating-point value is used in a module. More...
 
class  UseDefChains
 Use-def chains. More...
 
class  UseDefAnalysis
 An analysis providing use-def chains. More...
 
class  UsedTypes
 Used types in a module. More...
 
class  UsedTypesVisitor
 A visitor for obtaining the used types in the IR. More...
 
class  UsedVars
 Used variables for a value (expression, statement). More...
 
class  UsedVarsVisitor
 A visitor for obtaining the used variables in a value. More...
 
class  ValueData
 Information about a value. More...
 
class  ValueAnalysis
 An analysis for obtaining information about a value. More...
 
class  VarUses
 Representation of uses of a variable. More...
 
class  VarUsesVisitor
 A visitor for obtaining the uses of variables in a function. More...
 
class  WrittenIntoGlobalsVisitor
 A visitor for obtaining written-into global variables in functions. More...
 
class  ConfigError
 Base class for all config-related errors. More...
 
class  Config
 Base class for all configs. More...
 
class  JSONConfigError
 Base class for all exceptions raised by JSONConfig. More...
 
class  JSONConfigFileNotFoundError
 Exception raised when the config file does not exist. More...
 
class  JSONConfigParsingError
 Exception raised when there is a parsing error. More...
 
class  JSONConfig
 Config in the JSON format. More...
 
class  ArithmExprEvaluator
 A base class for all evaluators. More...
 
class  CArithmExprEvaluator
 Evaluates expressions with c language conditions. More...
 
class  StrictArithmExprEvaluator
 Evaluates expressions with strict conditions. More...
 
class  CFG
 A representation of a control-flow graph (CFG). More...
 
class  CFGBuilder
 A base class for creators of control-flow graphs (CFGs) from functions. More...
 
class  NonRecursiveCFGBuilder
 A non-recursive creator of control-flow graphs (CFGs) from functions. More...
 
class  RecursiveCFGBuilder
 A recursive creator of control-flow graphs (CFGs) from functions. More...
 
class  CFGTraversal
 A base class of all CFG traversals. More...
 
class  LhsRhsUsesCFGTraversal
 A CFG traversal that for an assign statement S returns the uses of its left-hand side such that there are no modifications of variables used in S before them. More...
 
class  ModifiedBeforeReadCFGTraversal
 A CFG traversal that checks whether a variable is modified prior to every read access to it starting from a given statement. More...
 
class  NoVarDefCFGTraversal
 A CFG traversal that checks whether no variable in a given set is defined/modified between a start statement and a set of end statements. More...
 
class  NodesOfVarUseCFGTraversal
 A CFG traversal that returns all nodes where the variables from VarDefStms are used. More...
 
class  OptimFuncInfoCFGTraversal
 A CFG traversal for computing OptimFuncInfos. More...
 
class  VarDefCFGTraversal
 A CFG traversal that checks whether a variable is defined/modified between two statements. More...
 
class  VarUseCFGTraversal
 A CFG traversal that checks whether a variable is defined/modified prior to every read access to it in a function. More...
 
class  CFGWriter
 A base class of all control-flow graph (CFG) writers. More...
 
class  GraphvizCFGWriter
 A CFG writer in the dot format (graphviz). More...
 
class  CG
 A representation of a call graph (CG). More...
 
class  CGBuilder
 A creator of call graphs (CGs) from modules. More...
 
class  CGWriter
 A base class of all call graph (CG) writers. More...
 
class  GraphvizCGWriter
 A CG writer in the dot format (graphviz). More...
 
class  BIRWriter
 
class  BracketManager
 A base class of all brackets managers. More...
 
class  CBracketManager
 A class that contains precedence table and overrided methods which decide of elimination redundant brackets for the C language. More...
 
class  NoBracketManager
 A class that that turns off eleminating redundant brackets. More...
 
class  CompoundOpManager
 A base class for compound operator managers. More...
 
class  CCompoundOpManager
 Compound operator manager for the C language. More...
 
class  NoCompoundOpManager
 Compound operator manager that turns off all compound optimizations. More...
 
class  HLLWriter
 A base class of all HLL writers. More...
 
class  CHLLWriter
 A HLL writer for the C language (C99). More...
 
class  OutputManager
 
class  JsonOutputManager
 
class  PlainOutputManager
 
class  AddOpExpr
 An addition operator. More...
 
class  AddressOpExpr
 An address operator. More...
 
class  AndOpExpr
 A logical "and" operator. More...
 
class  ArrayIndexOpExpr
 An array subscript operator. More...
 
class  ArrayType
 A representation of an array type. More...
 
class  AssignOpExpr
 An assignment operator. More...
 
class  AssignStmt
 An assignment statement. More...
 
class  BinaryOpExpr
 A base class for all binary operators. More...
 
class  BitAndOpExpr
 A bit-and operator. More...
 
class  BitCastExpr
 Cast of LLVM instruction BitCast. More...
 
class  BitOrOpExpr
 A bit-or operator. More...
 
class  BitShlOpExpr
 A bit left shift operator. More...
 
class  BitShrOpExpr
 A bit right shift operator. More...
 
class  BitXorOpExpr
 A bit-xor operator. More...
 
class  BreakStmt
 A break statement to exit a loop or a switch case. More...
 
class  CallExpr
 A call expression. More...
 
class  CallStmt
 A statement wrapping a call expression. More...
 
class  CastExpr
 Base class for cast instructions. More...
 
class  CommaOpExpr
 A comma operator. More...
 
class  ConstArray
 An array constant. More...
 
class  ConstBool
 A bool constant. More...
 
class  ConstFloat
 A float constant. More...
 
class  ConstInt
 An integer constant. More...
 
class  ConstNullPointer
 A null pointer constant. More...
 
class  ConstString
 A generic string constant. More...
 
class  ConstStruct
 A struct constant. More...
 
class  ConstSymbol
 A symbolic constant. More...
 
class  Constant
 A base class for all constants. More...
 
class  ContinueStmt
 A continue statement to continue looping. More...
 
class  DerefOpExpr
 A dereference operator. More...
 
class  DivOpExpr
 A division operator. More...
 
class  EmptyStmt
 An empty statement (like NOP). More...
 
class  EqOpExpr
 An equality operator. More...
 
class  Expression
 A base class of all expressions. More...
 
class  ExtCastExpr
 Cast of LLVM Ext instructions. More...
 
class  FloatType
 A representation of an float point type. More...
 
class  ForLoopStmt
 A for loop statement. More...
 
class  FPToIntCastExpr
 Cast of LLVM instructions FPtoSI/FPtoUI. More...
 
class  Function
 A representation of a function. More...
 
class  FunctionBuilder
 A builder providing a simple way of creating functions. More...
 
class  FunctionType
 A representation of a function type. More...
 
class  GlobalVarDef
 A definition of a global variable. More...
 
class  GotoStmt
 A goto statement for unconditional transfer of control. More...
 
class  GtEqOpExpr
 A greater-than-or-equal operator. More...
 
class  GtOpExpr
 A greater-than operator. More...
 
class  IfStmt
 An if/else-if/else statement. More...
 
class  IntToFPCastExpr
 Cast of LLVM instruction SItoFP/UItoFP. More...
 
class  IntToPtrCastExpr
 Cast of LLVM instruction IntToPtr. More...
 
class  IntType
 A representation of an integer type. More...
 
class  LtEqOpExpr
 A less-than-or-equal operator. More...
 
class  LtOpExpr
 A less-than operator. More...
 
class  ModOpExpr
 A modulo operator. More...
 
class  Module
 A representation of a complete module. More...
 
class  MulOpExpr
 A multiplication operator. More...
 
class  NegOpExpr
 An arithmetic negation operator. More...
 
class  NeqOpExpr
 A non-equality operator. More...
 
class  NotOpExpr
 A logical negation operator. More...
 
class  OrOpExpr
 A logical "or" operator. More...
 
class  PointerType
 A representation of a pointer type. More...
 
class  PtrToIntCastExpr
 Cast of LLVM instruction PtrToInt. More...
 
class  ReturnStmt
 A return statement. More...
 
class  Statement
 A representation of a program statement. More...
 
class  StringType
 A representation of a string type. More...
 
class  StructIndexOpExpr
 A struct index operator. More...
 
class  StructType
 A representation of a structured type. More...
 
class  SubOpExpr
 A subtraction operator. More...
 
class  SwitchStmt
 A switch statement. More...
 
class  TernaryOpExpr
 A ternary operator. More...
 
class  TruncCastExpr
 Cast of LLVM instructions FPTrunc/Trunc. More...
 
class  Type
 A base class of all types. More...
 
class  UForLoopStmt
 A universal for loop statement. More...
 
class  UnaryOpExpr
 A base class for all unary operators. More...
 
class  UnknownType
 A representation of an Unknown type. More...
 
class  UnreachableStmt
 An unreachable statement. More...
 
class  Value
 A base class of all objects a module can contain. More...
 
class  VarDefStmt
 A variable definition statement. More...
 
class  Variable
 A representation of a variable. More...
 
class  VoidType
 A representation of an void type. More...
 
class  WhileLoopStmt
 A while loop statement. More...
 
class  LLVMDebugInfoObtainer
 Obtainer of debug information from an LLVM module. More...
 
class  LLVMIntrinsicConverter
 Conversion of LLVM intrinsic functions into functions from the standard C library. More...
 
class  LLVMSupport
 Supportive functions regarding LLVM IR. More...
 
class  BasicBlockConverter
 A converter of LLVM basic blocks. More...
 
class  CFGNode
 A representation of a control-flow graph node. More...
 
class  LabelsHandler
 Handler of labels during conversion of LLVM IR to BIR. More...
 
class  LLVMConstantConverter
 A converter from LLVM constant to constant in BIR. More...
 
class  LLVMFCmpConverter
 A converter from LLVM fcmp instruction to expression in BIR. More...
 
class  LLVMInstructionConverter
 A converter from LLVM instruction to expression in BIR. More...
 
class  LLVMTypeConverter
 A converter from LLVM type to type in BIR. More...
 
class  LLVMValueConverter
 A converter from LLVM values to values in BIR. More...
 
class  StructureConverter
 A converter of the LLVM function structure. More...
 
class  VariablesManager
 Managing of local variables created during conversion of LLVM functions to BIR. More...
 
class  LLVMIR2BIRConverter
 A converter of LLVM IR to BIR. More...
 
class  LlvmIr2Hll
 This class is the main chunk of code that converts an LLVM module to the specified high-level language (HLL). More...
 
class  CallInfo
 Base class for all classes storing information about a function call. More...
 
class  FuncInfo
 Base class for all classes storing information about a function. More...
 
class  CallInfoObtainer
 A base class of all obtainers of information about functions and function calls. More...
 
class  OptimCallInfo
 Optimistic information about a function call. More...
 
class  OptimFuncInfo
 Optimistic information about a function. More...
 
class  OptimCallInfoObtainer
 Obtainer of information about functions and function calls that assumes it has access to complete information about the module. More...
 
class  PessimCallInfo
 Pessimistic information about a function call. More...
 
class  PessimFuncInfo
 Pessimistic information about a function. More...
 
class  PessimCallInfoObtainer
 Obtainer of information about functions and function calls that assumes nothing. More...
 
class  CallsInModuleObtainer
 An obtainer of information about function calls in a module. More...
 
class  CallsObtainer
 An obtainer of information about function calls. More...
 
class  FuncOptimizer
 A base class of all function optimizers. More...
 
class  Optimizer
 A base class of all optimizers. More...
 
class  OptimizerManager
 A manager managing optimizations. More...
 
class  AggressiveDerefOptimizer
 Optimizes dereferences of integer values. More...
 
class  AggressiveGlobalToLocalOptimizer
 Converts all global variables without a name from debug information to local variables. More...
 
class  BitOpToLogOpOptimizer
 Optimizes Optimizes BitAndExpr to AndOpExpr or BitOrExpr to OrOpExpr if fulfil conditions. More...
 
class  BitShiftOptimizer
 Change bit shift to division or multiplication. More...
 
class  BreakContinueReturnOptimizer
 Removes statements following a break, continue, or return statements. More...
 
class  CArrayArgOptimizer
 Optimizes array arguments of function calls. More...
 
class  CCastOptimizer
 Removes casts that are in the C language implicit. More...
 
class  CopyPropagationOptimizer
 Copy propagation optimization. More...
 
class  DeadCodeOptimizer
 Removes dead code. Examples are mentioned below. More...
 
class  DeadLocalAssignOptimizer
 Elimination of dead assignments to local variables. More...
 
class  DerefAddressOptimizer
 Optimizes dereferences of addresses. More...
 
class  DerefToArrayIndexOptimizer
 Optimizes pointer arithmetic on variables to array accesses. More...
 
class  EmptyArrayToStringOptimizer
 Optimizes global empty arrays to empty strings. More...
 
class  EmptyStmtOptimizer
 Removes empty statements. More...
 
class  GotoStmtOptimizer
 
class  IfBeforeLoopOptimizer
 Optimizes if statements before loops. More...
 
class  IfStructureOptimizer
 Optimizes the structure of if statements. More...
 
class  IfToSwitchOptimizer
 Optimizes if statements to switch statements. More...
 
class  LLVMIntrinsicsOptimizer
 Optimizes calls to LLVM intrinsic functions. More...
 
class  LoopLastContinueOptimizer
 Optimizes redundant continue statements in loops. More...
 
class  NoInitVarDefOptimizer
 Removes variable-defining statements with no initializer. More...
 
class  PreWhileTrueLoopConvOptimizer
 Optimizes the bodies of while True loops to simplify other optimizations of these loops. More...
 
class  RemoveAllCastsOptimizer
 Removes all casts from a module. More...
 
class  RemoveUselessCastsOptimizer
 Removes useless casts from a module. More...
 
class  SelfAssignOptimizer
 Removes self assignments. More...
 
class  SimpleCopyPropagationOptimizer
 A simple version of the copy propagation optimization. More...
 
class  BoolComparisonSubOptimizer
 Simplification of comparisons with true and false. More...
 
class  ChangeOrderOfOperandsSubOptimizer
 This optimizer changes order of operands. Examples are mentioned below. More...
 
class  ConstOperatorConstSubOptimizer
 This optimizer optimizes expressions where the first and the second operand is a constant. Examples are mentioned below. More...
 
class  EqualOperandsSubOptimizer
 This optimizer changes expressions where the first and the second operand is same one. Examples are mentioned below. More...
 
class  NegationOperatorSubOptimizer
 This optimizer optimizes negation operators outside of expressions. More...
 
class  NegativeOperandSubOptimizer
 This optimizer changes expressions where one of the operands is negative. Examples are mentioned below. More...
 
class  OneSubOptimizer
 This optimizer changes expressions where one of the operands is a number one. Examples are mentioned below. More...
 
class  SubOptimizer
 A base class for all simplify arithmetical expression optimizations. More...
 
class  TernaryOperatorSubOptimizer
 This optimizer optimizes ternary operator. Examples are mentioned below. More...
 
class  ThreeOperandsSubOptimizer
 This optimizer changes expressions which have two operators and at least two operands are constants. More...
 
class  ZeroSubOptimizer
 This optimizer changes expressions where one of the operands is a zero. Examples are mentioned below. More...
 
class  SimplifyArithmExprOptimizer
 Optimizer that optimizes expressions to a simpler form. More...
 
class  UnusedGlobalVarOptimizer
 Removes global variables that are not used. More...
 
class  VarDefForLoopOptimizer
 Optimizes VarDefStmts for induction variables of for loops. More...
 
class  VarDefStmtOptimizer
 Optimizes VarDefStmt to closest place of it's variable use. More...
 
class  VoidReturnOptimizer
 Optimizes redundant void returns. More...
 
class  WhileTrueToForLoopOptimizer
 Optimizes while loops into for loops. More...
 
class  WhileTrueToUForLoopOptimizer
 Optimizes while loops into universal for loops. More...
 
class  WhileTrueToWhileCondOptimizer
 Optimizes "while true" loops into "while cond" loops. More...
 
class  Pattern
 A base class for representing code patterns. More...
 
class  PatternFinder
 A base class for all pattern finders. More...
 
class  PatternFinderRunner
 A base class for all runners of pattern finders. More...
 
class  CLIPatternFinderRunner
 Runner of pattern finders for the command line interface (CLI). More...
 
class  NoActionPatternFinderRunner
 Runner of pattern finders that performs no additional actions. More...
 
class  APICallInfo
 A representation of information about an API call. More...
 
class  APICallInfoSeq
 A sequence of information about API calls. More...
 
class  APICallInfoSeqParser
 A parser of textual representation of API call sequences. More...
 
class  APICallSeqData
 A storage of intermediate data when finding sequences of API calls. More...
 
class  APICallSeqFinder
 A base class for all API calls finders. More...
 
class  BasicBlockAPICallSeqFinder
 API call finder which searches only in a basic block. More...
 
class  APICallPatternFinder
 Finds interesting API calls in a module. More...
 
class  APICallSeqPatternFinder
 Finds sequences of interesting API calls in a module. More...
 
class  StmtsPattern
 A pattern that is composed of zero or more statements. More...
 
class  CompoundSemantics
 A class providing compound semantics from several different semantics. More...
 
class  CompoundSemanticsBuilder
 A class providing an easy construction of compound semantics from several different semantics. More...
 
class  DefaultSemantics
 A default semantics which doesn't know anything. More...
 
class  GCCGeneralSemantics
 A general semantics for the GCC compiler. More...
 
class  LibcSemantics
 Semantics for the standard C library. More...
 
class  WinAPISemantics
 Semantics for Windows API. More...
 
class  Semantics
 A base class for all descriptions of function semantics. More...
 
class  Caching
 A mixin for enabling caching of computed results. More...
 
class  ConstSymbolConverter
 Converter of constants into their symbolic names. More...
 
class  ExprTypesFixer
 A visitor for fixing the types in the IR. More...
 
class  ExpressionNegater
 Negation of expressions. More...
 
class  DefaultFactoryError
 Handles the "Unknown Type" error in an object factory. More...
 
class  Factory
 Implementation of a generic object factory. More...
 
class  GlobalVarsSorter
 Sorts global variables according to the given conditions. More...
 
class  HeadersForDeclaredFuncs
 Retrieval of header files for all the declared functions in a module. More...
 
class  LibraryFuncsRemover
 Removes defined functions which are from some standard library whose header file has to be included because of some function declarations. More...
 
class  Metadatable
 A mixin providing metadata attached to objects. More...
 
class  Observer
 Implementation of a generic typed observer using shared pointers (observer part). More...
 
class  Singleton
 Implementation of the Singleton design pattern. More...
 
class  SharableFromThis
 Enables shared_from_this() in the inheriting class. More...
 
class  WkPtrEqPredicate
 A predicate for checking the equality of two weak pointers. More...
 
class  StatementsCounter
 Counter of the number of statements in a block. More...
 
class  StructTypesSorter
 Sorts structured types according to their names and dependencies. More...
 
class  Subject
 Implementation of a generic typed observer using shared pointers (subject part). More...
 
class  UnreachableCodeInCFGRemover
 Removes code that is unreachable in a CFG. More...
 
class  ValidState
 A mixin providing support for keeping the validity of an object. More...
 
class  ValueTextReprVisitor
 A visitor for obtaining a textual representation of a value. More...
 
class  VariableReplacer
 A replacer of variables in functions. More...
 
class  Visitable
 Interface for classes whose instances are visitable by a Visitor. More...
 
class  Visitor
 A base class of all visitors. More...
 
class  VisitorAdapter
 A visitor whose visit methods do nothing by default. More...
 
class  OrderedAllVisitor
 A visitor that visits everything in an ordered way. More...
 
class  UtilsGraphviz
 graphviz utilities. More...
 
struct  SplittedWhileTrueLoop
 A representation of a "while true" loop. More...
 
struct  IndVarInfo
 Information about the induction variable of a "while true" loop. More...
 
class  Validator
 A base class for all validators. More...
 
class  BreakOutsideLoopValidator
 A validator which checks that no break or continue statement appears where it should not appear. More...
 
class  NoGlobalVarDefValidator
 A validator which checks that no global variable is defined in a VarDefStmt. More...
 
class  ReturnValidator
 A validator which checks returns from functions. More...
 
class  VarNameGen
 A base class for all generators of variable names. More...
 
class  FruitVarNameGen
 A generator of fruit names as variable names. More...
 
class  NumVarNameGen
 A generator of variable names of the form prefixN, where N is a number. More...
 
class  WordVarNameGen
 A generator of words as variable names. More...
 
class  VarRenamer
 A base class for all variable renamers. More...
 
class  AddressVarRenamer
 A renamer of variable names which extracts and uses the original addresses of the variables. More...
 
class  HungarianVarRenamer
 A renamer of variable names by using the Hungarian notation. More...
 
class  ReadableVarRenamer
 A renamer of variable names which names them to make the code as readable as possible. More...
 
class  SimpleVarRenamer
 A renamer of variable names which names them simply by using the given variable name generator. More...
 
class  UnifiedVarRenamer
 A renamer of variable names which names the variables gX (global variables), aX (parameters), and vX (local variables). More...
 

Typedefs

using AliasAnalysisFactory = Singleton< Factory< AliasAnalysis, std::string, ShPtr< AliasAnalysis >(*)() > >
 Factory that creates instances of classes derived from AliasAnalysis. More...
 
using ArithmExprEvaluatorFactory = Singleton< Factory< ArithmExprEvaluator, std::string, ShPtr< ArithmExprEvaluator >(*)() > >
 Factory that creates instances of classes derived from ArithmExprEvaluator. More...
 
using CFGWriterFactory = Singleton< Factory< CFGWriter, std::string, ShPtr< CFGWriter >(*)(ShPtr< CFG >, std::ostream &) > >
 Factory that creates instances of classes derived from CFGWriter. More...
 
using CGWriterFactory = Singleton< Factory< CGWriter, std::string, ShPtr< CGWriter >(*)(ShPtr< CG >, std::ostream &) > >
 Factory that creates instances of classes derived from CGWriter. More...
 
using HLLWriterFactory = Singleton< Factory< HLLWriter, std::string, ShPtr< HLLWriter >(*)(llvm::raw_ostream &, const std::string &) > >
 Factory that creates instances of classes derived from HLLWriter. More...
 
using JsonOutputManagerPlain = JsonOutputManager< rapidjson::Writer< rapidjson::StringBuffer, rapidjson::ASCII<> >>
 
using JsonOutputManagerPretty = JsonOutputManager< rapidjson::PrettyWriter< rapidjson::StringBuffer, rapidjson::ASCII<> >>
 
using CallInfoObtainerFactory = Singleton< Factory< CallInfoObtainer, std::string, ShPtr< CallInfoObtainer >(*)() > >
 Factory that creates instances of classes derived from CallInfoObtainer. More...
 
using SubOptimizerFactory = Singleton< Factory< SubOptimizer, std::string, ShPtr< SubOptimizer >(*)(ShPtr< ArithmExprEvaluator >) > >
 Factory that creates instances of classes derived from SubOptimizer. More...
 
using PatternFinderFactory = Singleton< Factory< PatternFinder, std::string, ShPtr< PatternFinder >(*)(ShPtr< ValueAnalysis >, ShPtr< CallInfoObtainer >) > >
 Factory that creates instances of classes derived from PatternFinder. More...
 
using SemanticsFactory = Singleton< Factory< Semantics, std::string, ShPtr< Semantics >(*)() > >
 Factory that creates instances of classes derived from Semantics. More...
 
template<typename T >
using ShPtr = std::shared_ptr< T >
 An alias for a shared pointer. More...
 
template<typename T >
using WkPtr = std::weak_ptr< T >
 An alias for a weak pointer. More...
 
template<typename T >
using UPtr = std::unique_ptr< T >
 An alias for a unique pointer. More...
 
using Address = retdec::common::Address
 Address. More...
 
using AddressRange = retdec::common::AddressRange
 Address range. More...
 
using LineRange = std::pair< std::uint64_t, std::uint64_t >
 Line range. More...
 
using StringSet = std::set< std::string >
 Set of strings. More...
 
using ValueSet = std::set< ShPtr< Value > >
 Set of values. More...
 
using VarSet = std::set< ShPtr< Variable > >
 Set of variables. More...
 
using VarDefStmtSet = std::set< ShPtr< VarDefStmt > >
 Set of VarDefStmt. More...
 
using TypeSet = std::set< ShPtr< Type > >
 Set of types. More...
 
using StructTypeSet = std::set< ShPtr< StructType > >
 Set of structured types. More...
 
using StmtSet = std::set< ShPtr< Statement > >
 Set of statements. More...
 
using ExpressionSet = std::set< ShPtr< Expression > >
 Set of expressions. More...
 
using CallSet = std::set< ShPtr< CallExpr > >
 Set of function calls. More...
 
using FuncSet = std::set< ShPtr< Function > >
 Set of functions. More...
 
using StmtUSet = std::unordered_set< ShPtr< Statement > >
 Unordered set of statements. More...
 
using TypeUSet = std::unordered_set< ShPtr< Type > >
 Unordered set of types. More...
 
using StringVector = std::vector< std::string >
 Vector of strings. More...
 
using ValueVector = std::vector< ShPtr< Value > >
 Vector of values. More...
 
using VarVector = std::vector< ShPtr< Variable > >
 Vector of variables. More...
 
using StmtVector = std::vector< ShPtr< Statement > >
 Vector of statements. More...
 
using ExprVector = std::vector< ShPtr< Expression > >
 Vector of expressions. More...
 
using CallVector = std::vector< ShPtr< CallExpr > >
 Vector of function calls. More...
 
using FuncVector = std::vector< ShPtr< Function > >
 Vector of functions. More...
 
using GlobalVarDefVector = std::vector< ShPtr< GlobalVarDef > >
 Vector of global variable definitions. More...
 
using StructTypeVector = std::vector< ShPtr< StructType > >
 Vector of structured types. More...
 
using VarInitPair = std::pair< ShPtr< Variable >, ShPtr< Expression > >
 Variable with its initializer. More...
 
using VarInitPairVector = std::vector< VarInitPair >
 List of variables with their initializers. More...
 
using StringStringMap = std::map< std::string, std::string >
 Mapping of a string into a string. More...
 
using StringTypeMap = std::map< std::string, ShPtr< Type > >
 Mapping of a string into a type. More...
 
using VarStringMap = std::map< ShPtr< Variable >, std::string >
 Mapping of a variable into a string. More...
 
using StringVarMap = std::map< std::string, ShPtr< Variable > >
 Mapping of a string into a variable. More...
 
using FuncStringMap = std::map< ShPtr< Function >, std::string >
 Mapping of a function into a string. More...
 
using IntStringMap = std::map< std::int64_t, std::string >
 Mapping of a 64b int into a string. More...
 
using VarVarSetMap = std::map< ShPtr< Variable >, VarSet >
 Mapping of a variable into a set of variables. More...
 
using StringStringUMap = std::unordered_map< std::string, std::string >
 Unordered mapping of a string into a string. More...
 
using ValidatorFactory = Singleton< Factory< Validator, std::string, ShPtr< Validator >(*)() > >
 Factory that creates instances of classes derived from Validator. More...
 
using VarNameGenFactory = Singleton< Factory< VarNameGen, std::string, UPtr< VarNameGen >(*)(std::string) > >
 Factory that creates instances of classes derived from VarNameGen. More...
 
using VarRenamerFactory = Singleton< Factory< VarRenamer, std::string, ShPtr< VarRenamer >(*)(ShPtr< VarNameGen >, bool) > >
 Factory that creates instances of classes derived from VarRenamer. More...
 

Enumerations

enum class  SwitchParent { Yes , No }
 Enum class to distinguish when parent of statement is switch or not. More...
 

Functions

template<typename T >
T & id (T &object)
 Returns object. More...
 
template<typename To , typename From >
ShPtr< To > cast (const ShPtr< From > &ptr) noexcept
 Equivalent of dynamic_cast<> for shared pointers. More...
 
template<typename To , typename From >
ShPtr< To > ucast (const ShPtr< From > &ptr) noexcept
 Equivalent of static_cast<> for shared pointers (unchecked cast). More...
 
template<typename To , typename From >
bool isa (const ShPtr< From > &ptr) noexcept
 Returns true if ptr is of type To or can be casted from From to To, false otherwise. More...
 
bool isLoopEnd (ShPtr< Statement > stmt)
 Returns true if stmt is the ending statement of a loop, false otherwise. More...
 
ShPtr< ExpressiongetExitCondition (ShPtr< Statement > loopEnd)
 Returns the exit condition from the given loop end. More...
 
ShPtr< SplittedWhileTrueLoopsplitWhileTrueLoop (ShPtr< WhileLoopStmt > stmt, ShPtr< IndVarInfo > indVarInfo)
 Splits the given "while True" loop stmt into three parts. More...
 
ShPtr< IndVarInfogetIndVarInfo (ShPtr< WhileLoopStmt > stmt)
 Returns information about the induction variable in the given "while true" loop. More...
 
 REGISTER_AT_FACTORY ("basic", BASIC_ALIAS_ANALYSIS_ID, AliasAnalysisFactory, BasicAliasAnalysis::create)
 
 REGISTER_AT_FACTORY ("simple", SIMPLE_ALIAS_ANALYSIS_ID, AliasAnalysisFactory, SimpleAliasAnalysis::create)
 
 REGISTER_AT_FACTORY ("c", C_ARITHM_EXPR_EVALUATOR_ID, ArithmExprEvaluatorFactory, CArithmExprEvaluator::create)
 
 REGISTER_AT_FACTORY ("strict", STRICT_ARITHM_EXPR_EVALUATOR_ID, ArithmExprEvaluatorFactory, StrictArithmExprEvaluator::create)
 
 REGISTER_AT_FACTORY ("dot", GRAPHVIZ_CFG_WRITER_ID, CFGWriterFactory, GraphvizCFGWriter::create)
 
 REGISTER_AT_FACTORY ("dot", GRAPHVIZ_CG_WRITER_ID, CGWriterFactory, GraphvizCGWriter::create)
 
 REGISTER_AT_FACTORY ("c", C_HLL_WRITER_ID, HLLWriterFactory, CHLLWriter::create)
 
static RegisterPass< LlvmIr2HllX ("retdec-llvmir2hll", "LLVM IR -> HLL", false, false)
 
 REGISTER_AT_FACTORY ("optim", OPTIM_CALL_INFO_OBTAINER_ID, CallInfoObtainerFactory, OptimCallInfoObtainer::create)
 
 REGISTER_AT_FACTORY ("pessim", PESSIM_CALL_INFO_OBTAINER_ID, CallInfoObtainerFactory, PessimCallInfoObtainer::create)
 
 REGISTER_AT_FACTORY ("BoolComparison", BOOL_COMPARISON_OPTIMIZER_ID, SubOptimizerFactory, BoolComparisonSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("ChangeOrderOfOperands", CHANGE_ORDER_OF_OPERANDS_SUB_OPTIMIZER_ID, SubOptimizerFactory, ChangeOrderOfOperandsSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("ConstOperatorConst", CONST_OPERATOR_CONST_SUB_OPTIMIZER_ID, SubOptimizerFactory, ConstOperatorConstSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("EqualOperands", EQUAL_OPERANDS_SUB_OPTIMIZER_ID, SubOptimizerFactory, EqualOperandsSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("NegationOperator", NEGATION_OPERATOR_SUB_OPTIMIZER_ID, SubOptimizerFactory, NegationOperatorSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("NegativeOperand", NEGATIVE_OPERAND_SUB_OPTIMIZER_ID, SubOptimizerFactory, NegativeOperandSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("One", ONE_SUB_OPTIMIZER_ID, SubOptimizerFactory, OneSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("TernaryOperator", TERNARY_OPERATOR_SUB_OPTIMIZER_ID, SubOptimizerFactory, TernaryOperatorSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("ThreeOperands", OP_OPER_OP_OPER_OP_SUB_OPTIMIZER_ID, SubOptimizerFactory, ThreeOperandsSubOptimizer::create)
 
 REGISTER_AT_FACTORY ("Zero", ZERO_SUB_OPTIMIZER_ID, SubOptimizerFactory, ZeroSubOptimizer::create)
 
bool compareVarDefStms (const ShPtr< VarDefStmt > &v1, const ShPtr< VarDefStmt > &v2)
 Compares the two given VarDefStms by their name. More...
 
 REGISTER_AT_FACTORY ("APICall", API_CALL_PATTERN_FINDER_ID, PatternFinderFactory, APICallPatternFinder::create)
 
 REGISTER_AT_FACTORY ("APICallSeq", API_CALL_SEQ_PATTERN_FINDER_ID, PatternFinderFactory, APICallSeqPatternFinder::create)
 
 REGISTER_AT_FACTORY ("default", DEFAULT_SEMANTICS_ID, SemanticsFactory, DefaultSemantics::create)
 
 REGISTER_AT_FACTORY ("gcc-general", GCC_GENERAL_SEMANTICS_ID, SemanticsFactory, GCCGeneralSemantics::create)
 
 REGISTER_AT_FACTORY ("libc", LIBC_SEMANTICS_ID, SemanticsFactory, LibcSemantics::create)
 
 REGISTER_AT_FACTORY ("win-api", WIN_API_SEMANTICS_ID, SemanticsFactory, WinAPISemantics::create)
 
 REGISTER_AT_FACTORY ("BreakOutsideLoop", BREAK_OUTSIDE_LOOP_VALIDATOR_ID, ValidatorFactory, BreakOutsideLoopValidator::create)
 
 REGISTER_AT_FACTORY ("NoGlobalVarDef", NO_GLOBAL_VAR_DEF_VALIDATOR_ID, ValidatorFactory, NoGlobalVarDefValidator::create)
 
 REGISTER_AT_FACTORY ("Return", RETURN_VALIDATOR_ID, ValidatorFactory, ReturnValidator::create)
 
 REGISTER_AT_FACTORY ("fruit", FRUIT_VAR_NAME_GEN_ID, VarNameGenFactory, FruitVarNameGen::create)
 
 REGISTER_AT_FACTORY ("num", NUM_VAR_NAME_GEN_ID, VarNameGenFactory, NumVarNameGen::create)
 
 REGISTER_AT_FACTORY ("word", WORD_VAR_NAME_GEN_ID, VarNameGenFactory, WordVarNameGen::create)
 
 REGISTER_AT_FACTORY ("address", ADDRESS_VAR_RENAMER_ID, VarRenamerFactory, AddressVarRenamer::create)
 
 REGISTER_AT_FACTORY ("hungarian", HUNGARIAN_VAR_RENAMER_ID, VarRenamerFactory, HungarianVarRenamer::create)
 
 REGISTER_AT_FACTORY ("readable", READABLE_VAR_RENAMER_ID, VarRenamerFactory, ReadableVarRenamer::create)
 
 REGISTER_AT_FACTORY ("simple", SIMPLE_VAR_RENAMER_ID, VarRenamerFactory, SimpleVarRenamer::create)
 
 REGISTER_AT_FACTORY ("unified", UNIFIED_VAR_RENAMER_ID, VarRenamerFactory, UnifiedVarRenamer::create)
 
Emission To Streams
llvm::raw_ostream & operator<< (llvm::raw_ostream &os, const ShPtr< Value > &value)
 Emits value into os. More...
 
std::ostream & operator<< (std::ostream &os, Value *value)
 Emits value into os. More...
 
Querying
bool is8BitStringLiteral (const llvm::ConstantArray *ca)
 Checks if the given LLVM constant array represents an 8-bit string literal. More...
 
bool stores8BitStringLiteral (const llvm::GlobalVariable *v)
 Checks if the global variable stores an 8-bit string literal. More...
 
Conversions
ShPtr< ConstStringtoConstString (llvm::ConstantArray *ca)
 Converts the given LLVM constant array into ConstString. More...
 
ShPtr< ConstStringtoConstString (llvm::ConstantDataArray *cda)
 Converts the given LLVM constant data array into ConstString. More...
 
ShPtr< ConstStringgetInitializerAsConstString (llvm::GlobalVariable *v)
 Returns the initializer of the given global variable as ConstString. More...
 
Dumps
template<class Container , class DumpFunc >
void dump (const Container &container, DumpFunc dumpFunc, const std::string &delim=", ", const std::string &end="\n")
 Dumps the contents of the given container to standard error using the given dumping function. More...
 
template<class Container >
void dump (const Container &container, const std::string &delim=", ", const std::string &end="\n")
 Dumps the contents of the given container to standard error. More...
 
template<class T >
std::string dumpFuncGetName (T object)
 A dumping function which, given an object pointer, calls getName() on it via ->. More...
 
template<class T >
std::string dumpFuncGetTextRepr (T object)
 A dumping function which, given an object pointer, calls getTextRepr() on it via ->. More...
 
Operations Over Backend IR
void sortByName (FuncVector &vec)
 Sorts the given vector by the name of its elements (case-insensitively). More...
 
void sortByName (VarVector &vec)
 Sorts the given vector by the name of its elements (case-insensitively). More...
 
void sortByName (VarInitPairVector &vec)
 Sorts the given vector by the name of its elements (case-insensitively). More...
 
ShPtr< StatementskipEmptyStmts (ShPtr< Statement > stmts)
 Skips empty statements in stmt. More...
 
ShPtr< ExpressionskipCasts (ShPtr< Expression > expr)
 Skips casts in the given expression and returns the first non-cast expression. More...
 
ShPtr< ExpressionskipDerefs (ShPtr< Expression > expr)
 Skips dereferences in the given expression and returns the first non-dereference expression. More...
 
ShPtr< ExpressionskipAddresses (ShPtr< Expression > expr)
 Skips addresses in the given expression and returns the first non-address expression. More...
 
bool endsWithRetOrUnreach (ShPtr< Statement > stmts)
 Returns true if the sequence of statements stmts ends with a return or unreachable statement, false otherwise. More...
 
ShPtr< ExpressiongetLhs (ShPtr< Statement > stmt)
 Returns the left-hand side of the given variable definition/assign statement. More...
 
ShPtr< ExpressiongetRhs (ShPtr< Statement > stmt)
 Returns the right-hand side of the given variable definition/assign statement. More...
 
StmtVector removeVarDefOrAssignStatement (ShPtr< Statement > stmt, ShPtr< Function > func)
 Removes the given variable definition/assignment statement. More...
 
void replaceVarWithExprInStmt (ShPtr< Variable > var, ShPtr< Expression > expr, ShPtr< Statement > stmt)
 Replaces var with expr in stmt. More...
 
bool isVarDefOrAssignStmt (ShPtr< Statement > stmt)
 Returns true if stmt is a VarDefStmt or AssignStmt, false otherwise. More...
 
bool isLoop (ShPtr< Statement > stmt)
 Returns true if stmt is a loop, false otherwise. More...
 
bool isInfiniteEmptyLoop (ShPtr< WhileLoopStmt > stmt)
 Returns true if the given loop is both empty and infinite, false otherwise. More...
 
bool isWhileTrueLoop (ShPtr< WhileLoopStmt > stmt)
 Returns true if stmt is a while True loop, false otherwise. More...
 
ShPtr< FunctiongetCalledFunc (ShPtr< CallExpr > callExpr, ShPtr< Module > module)
 Returns the function called in call. More...
 
std::string getNameOfCalledFunc (ShPtr< CallExpr > callExpr, ShPtr< Module > module)
 Returns the name of the function called in call. More...
 
bool isCallByPointer (ShPtr< Expression > callExpr, ShPtr< Module > module)
 Returns true if the given call expression callExpr in the given module is indirect (by a pointer), false otherwise. More...
 
ShPtr< StatementgetInnermostLoop (ShPtr< Statement > stmt)
 Returns the innermost loop inside which stmt is. More...
 
ShPtr< StatementgetInnermostLoopOrSwitch (ShPtr< Statement > stmt)
 Returns the innermost loop or switch inside which stmt is. More...
 
bool isDefOfVar (ShPtr< Statement > stmt, ShPtr< Variable > var)
 Returns true if stmt defines var, false otherwise. More...
 
void addLocalVarToFunc (ShPtr< Variable > var, ShPtr< Function > func, ShPtr< Expression > init)
 Adds var as a new local variable of func, possibly with an initializer init. More...
 
void convertGlobalVarToLocalVarInFunc (ShPtr< Variable > var, ShPtr< Function > func, ShPtr< Expression > init)
 Converts the given global variable var into a local variable of func, possibly with the given initializer init. More...
 
Operations with Strings
std::string makeIdentifierValid (const std::string &id)
 Replaces invalid characters by valid ones in the given identifier. More...
 
std::string getAddressFromName (const std::string &name, const std::string &prefix)
 Returns the address extracted from the given name. More...
 
std::string getOffsetFromName (const std::string &name)
 Returns the offset extracted from the given name. More...
 
std::string getAddressFromLabel (const std::string &label, const std::string &labelPrefix, const std::string &addressPrefix)
 Tries to extract an address from the given basic block label. More...
 

Variables

const AddressRange NO_ADDRESS_RANGE = AddressRange(0, 0)
 No address range. More...
 
const LineRange NO_LINE_RANGE = LineRange(0, 0)
 No line range. More...
 
const bool debug_enabled = false
 

Typedef Documentation

◆ Address

Address.

◆ AddressRange

Address range.

◆ AliasAnalysisFactory

Factory that creates instances of classes derived from AliasAnalysis.

◆ ArithmExprEvaluatorFactory

Factory that creates instances of classes derived from ArithmExprEvaluator.

◆ CallInfoObtainerFactory

Factory that creates instances of classes derived from CallInfoObtainer.

◆ CallSet

using retdec::llvmir2hll::CallSet = typedef std::set<ShPtr<CallExpr> >

Set of function calls.

◆ CallVector

using retdec::llvmir2hll::CallVector = typedef std::vector<ShPtr<CallExpr> >

Vector of function calls.

◆ CFGWriterFactory

using retdec::llvmir2hll::CFGWriterFactory = typedef Singleton< Factory< CFGWriter, std::string, ShPtr<CFGWriter> (*)(ShPtr<CFG>, std::ostream &) > >

Factory that creates instances of classes derived from CFGWriter.

◆ CGWriterFactory

using retdec::llvmir2hll::CGWriterFactory = typedef Singleton< Factory< CGWriter, std::string, ShPtr<CGWriter> (*)(ShPtr<CG>, std::ostream &) > >

Factory that creates instances of classes derived from CGWriter.

◆ ExpressionSet

using retdec::llvmir2hll::ExpressionSet = typedef std::set<ShPtr<Expression> >

Set of expressions.

◆ ExprVector

using retdec::llvmir2hll::ExprVector = typedef std::vector<ShPtr<Expression> >

Vector of expressions.

◆ FuncSet

using retdec::llvmir2hll::FuncSet = typedef std::set<ShPtr<Function> >

Set of functions.

◆ FuncStringMap

using retdec::llvmir2hll::FuncStringMap = typedef std::map<ShPtr<Function>, std::string>

Mapping of a function into a string.

◆ FuncVector

using retdec::llvmir2hll::FuncVector = typedef std::vector<ShPtr<Function> >

Vector of functions.

◆ GlobalVarDefVector

Vector of global variable definitions.

◆ HLLWriterFactory

using retdec::llvmir2hll::HLLWriterFactory = typedef Singleton< Factory< HLLWriter, std::string, ShPtr<HLLWriter> (*)(llvm::raw_ostream &, const std::string&) > >

Factory that creates instances of classes derived from HLLWriter.

◆ IntStringMap

using retdec::llvmir2hll::IntStringMap = typedef std::map<std::int64_t, std::string>

Mapping of a 64b int into a string.

◆ JsonOutputManagerPlain

using retdec::llvmir2hll::JsonOutputManagerPlain = typedef JsonOutputManager<rapidjson::Writer<rapidjson::StringBuffer, rapidjson::ASCII<> >>

◆ JsonOutputManagerPretty

using retdec::llvmir2hll::JsonOutputManagerPretty = typedef JsonOutputManager<rapidjson::PrettyWriter<rapidjson::StringBuffer, rapidjson::ASCII<> >>

◆ LineRange

using retdec::llvmir2hll::LineRange = typedef std::pair<std::uint64_t, std::uint64_t>

Line range.

◆ PatternFinderFactory

Factory that creates instances of classes derived from PatternFinder.

◆ SemanticsFactory

using retdec::llvmir2hll::SemanticsFactory = typedef Singleton< Factory< Semantics, std::string, ShPtr<Semantics> (*)() > >

Factory that creates instances of classes derived from Semantics.

◆ ShPtr

template<typename T >
using retdec::llvmir2hll::ShPtr = typedef std::shared_ptr<T>

An alias for a shared pointer.

◆ StmtSet

using retdec::llvmir2hll::StmtSet = typedef std::set<ShPtr<Statement> >

Set of statements.

◆ StmtUSet

using retdec::llvmir2hll::StmtUSet = typedef std::unordered_set<ShPtr<Statement> >

Unordered set of statements.

◆ StmtVector

using retdec::llvmir2hll::StmtVector = typedef std::vector<ShPtr<Statement> >

Vector of statements.

◆ StringSet

using retdec::llvmir2hll::StringSet = typedef std::set<std::string>

Set of strings.

◆ StringStringMap

using retdec::llvmir2hll::StringStringMap = typedef std::map<std::string, std::string>

Mapping of a string into a string.

◆ StringStringUMap

using retdec::llvmir2hll::StringStringUMap = typedef std::unordered_map<std::string, std::string>

Unordered mapping of a string into a string.

◆ StringTypeMap

using retdec::llvmir2hll::StringTypeMap = typedef std::map<std::string, ShPtr<Type> >

Mapping of a string into a type.

◆ StringVarMap

using retdec::llvmir2hll::StringVarMap = typedef std::map<std::string, ShPtr<Variable> >

Mapping of a string into a variable.

◆ StringVector

using retdec::llvmir2hll::StringVector = typedef std::vector<std::string>

Vector of strings.

◆ StructTypeSet

using retdec::llvmir2hll::StructTypeSet = typedef std::set<ShPtr<StructType> >

Set of structured types.

◆ StructTypeVector

using retdec::llvmir2hll::StructTypeVector = typedef std::vector<ShPtr<StructType> >

Vector of structured types.

◆ SubOptimizerFactory

Factory that creates instances of classes derived from SubOptimizer.

◆ TypeSet

using retdec::llvmir2hll::TypeSet = typedef std::set<ShPtr<Type> >

Set of types.

◆ TypeUSet

using retdec::llvmir2hll::TypeUSet = typedef std::unordered_set<ShPtr<Type> >

Unordered set of types.

◆ UPtr

template<typename T >
using retdec::llvmir2hll::UPtr = typedef std::unique_ptr<T>

An alias for a unique pointer.

◆ ValidatorFactory

using retdec::llvmir2hll::ValidatorFactory = typedef Singleton< Factory< Validator, std::string, ShPtr<Validator> (*)() > >

Factory that creates instances of classes derived from Validator.

◆ ValueSet

using retdec::llvmir2hll::ValueSet = typedef std::set<ShPtr<Value> >

Set of values.

◆ ValueVector

using retdec::llvmir2hll::ValueVector = typedef std::vector<ShPtr<Value> >

Vector of values.

◆ VarDefStmtSet

using retdec::llvmir2hll::VarDefStmtSet = typedef std::set<ShPtr<VarDefStmt> >

Set of VarDefStmt.

◆ VarInitPair

Variable with its initializer.

◆ VarInitPairVector

using retdec::llvmir2hll::VarInitPairVector = typedef std::vector<VarInitPair>

List of variables with their initializers.

◆ VarNameGenFactory

using retdec::llvmir2hll::VarNameGenFactory = typedef Singleton< Factory< VarNameGen, std::string, UPtr<VarNameGen> (*)(std::string) > >

Factory that creates instances of classes derived from VarNameGen.

◆ VarRenamerFactory

Factory that creates instances of classes derived from VarRenamer.

◆ VarSet

using retdec::llvmir2hll::VarSet = typedef std::set<ShPtr<Variable> >

Set of variables.

◆ VarStringMap

using retdec::llvmir2hll::VarStringMap = typedef std::map<ShPtr<Variable>, std::string>

Mapping of a variable into a string.

◆ VarVarSetMap

Mapping of a variable into a set of variables.

◆ VarVector

using retdec::llvmir2hll::VarVector = typedef std::vector<ShPtr<Variable> >

Vector of variables.

◆ WkPtr

template<typename T >
using retdec::llvmir2hll::WkPtr = typedef std::weak_ptr<T>

An alias for a weak pointer.

Enumeration Type Documentation

◆ SwitchParent

Enum class to distinguish when parent of statement is switch or not.

Enumerator
Yes 
No 

Function Documentation

◆ addLocalVarToFunc()

void retdec::llvmir2hll::addLocalVarToFunc ( ShPtr< Variable var,
ShPtr< Function func,
ShPtr< Expression init 
)

Adds var as a new local variable of func, possibly with an initializer init.

An advatage of using this function over manually adding var to func is that this function also creates a VarDefStmt at the beginning of func, and places it in a proper place so that all VarDefStmts at the beginning of func are sorted alphabetically.

If var is already a local variable of func, this function does nothing.

Preconditions
  • func is a definition, not a declaration

◆ cast()

template<typename To , typename From >
ShPtr<To> retdec::llvmir2hll::cast ( const ShPtr< From > &  ptr)
noexcept

Equivalent of dynamic_cast<> for shared pointers.

Parameters
[in]ptrPointer to be casted.
Template Parameters
ToOutput type.
FromInput type.

The purpose of this function is to provide a more concise notation. Indeed, cast<X>(ptr) is more concise than std::dynamic_pointer_cast<X>(ptr).

◆ compareVarDefStms()

bool retdec::llvmir2hll::compareVarDefStms ( const ShPtr< VarDefStmt > &  v1,
const ShPtr< VarDefStmt > &  v2 
)

Compares the two given VarDefStms by their name.

Returns
true if the name of v1 comes before the name of v2 (case-insensitively), false otherwise.

◆ convertGlobalVarToLocalVarInFunc()

void retdec::llvmir2hll::convertGlobalVarToLocalVarInFunc ( ShPtr< Variable var,
ShPtr< Function func,
ShPtr< Expression init 
)

Converts the given global variable var into a local variable of func, possibly with the given initializer init.

The converted variable gets the same name as the global variable.

Preconditions
  • var is a global variable
  • func is a definition, not a declaration

◆ dump() [1/2]

template<class Container >
void retdec::llvmir2hll::dump ( const Container &  container,
const std::string &  delim = ", ",
const std::string &  end = "\n" 
)

Dumps the contents of the given container to standard error.

Parameters
[in]containerContainer whose contents has to be dumped.
[in]delimDelimiter used to separate individual items.
[in]endString to end the output with.
Template Parameters
ContainerType of the container.

◆ dump() [2/2]

template<class Container , class DumpFunc >
void retdec::llvmir2hll::dump ( const Container &  container,
DumpFunc  dumpFunc,
const std::string &  delim = ", ",
const std::string &  end = "\n" 
)

Dumps the contents of the given container to standard error using the given dumping function.

Parameters
[in]containerContainer whose contents has to be dumped.
[in]dumpFuncFunction that is called on every element. It has to return a dumpable value (e.g. a string).
[in]delimDelimiter used to separate individual items.
[in]endString to end the output with.
Template Parameters
ContainerType of the container.
DumpFuncType of the dumping function.

◆ dumpFuncGetName()

template<class T >
std::string retdec::llvmir2hll::dumpFuncGetName ( object)

A dumping function which, given an object pointer, calls getName() on it via ->.

Template Parameters
TUnderlying type of object. Must have a std::string getName() member function.

◆ dumpFuncGetTextRepr()

template<class T >
std::string retdec::llvmir2hll::dumpFuncGetTextRepr ( object)

A dumping function which, given an object pointer, calls getTextRepr() on it via ->.

Template Parameters
TUnderlying type of object. Must have a std::string getTextRepr() member function.

◆ endsWithRetOrUnreach()

bool retdec::llvmir2hll::endsWithRetOrUnreach ( ShPtr< Statement stmts)

Returns true if the sequence of statements stmts ends with a return or unreachable statement, false otherwise.

If stmts is the null pointer, it returns false.

◆ getAddressFromLabel()

std::string retdec::llvmir2hll::getAddressFromLabel ( const std::string &  label,
const std::string &  labelPrefix,
const std::string &  addressPrefix 
)

Tries to extract an address from the given basic block label.

Parameters
[in]labelLabel name from which the address is extracted.
[in]labelPrefixExpected prefix of label.
[in]addressPrefixThe prefix to be prepended before the address.

All the hexadecimal numbers in the address are converted to lowercase. If there is no address, this function returns label.

Examples:

pc_89004c5 (pc_) -> 0x89004c5
pc_804aa06.backedge (pc_) -> 0x804aa06
pc_804abb8.pc_804abb8_crit_edge (pc_) -> 0x804abb8

◆ getAddressFromName()

std::string retdec::llvmir2hll::getAddressFromName ( const std::string &  name,
const std::string &  prefix 
)

Returns the address extracted from the given name.

Parameters
[in]nameName from which the address should be extracted.
[in]prefixIf the extracted address is non-empty, this prefix is prepended before it.

If the address cannot be extracted, it returns the empty string.

Possible formats of names and their extracted addresses:

- xxx_8900438 -> 8900438
- xxx_8900438_1 -> 8900438_1

◆ getCalledFunc()

ShPtr< Function > retdec::llvmir2hll::getCalledFunc ( ShPtr< CallExpr callExpr,
ShPtr< Module module 
)

Returns the function called in call.

If the call is indirect, the null pointer is returned.

◆ getExitCondition()

ShPtr< Expression > retdec::llvmir2hll::getExitCondition ( ShPtr< Statement loopEnd)

Returns the exit condition from the given loop end.

Preconditions
  • loopEnd is a loop's end

◆ getIndVarInfo()

ShPtr< IndVarInfo > retdec::llvmir2hll::getIndVarInfo ( ShPtr< WhileLoopStmt stmt)

Returns information about the induction variable in the given "while true" loop.

If the loop either isn't a "while True" loop or complete information cannot be obtained, the null pointer is returned.

◆ getInitializerAsConstString()

ShPtr< ConstString > retdec::llvmir2hll::getInitializerAsConstString ( llvm::GlobalVariable *  v)

Returns the initializer of the given global variable as ConstString.

◆ getInnermostLoop()

ShPtr< Statement > retdec::llvmir2hll::getInnermostLoop ( ShPtr< Statement stmt)

Returns the innermost loop inside which stmt is.

If there is no innermost loop, it returns the null pointer.

Preconditions
  • stmt is non-null

◆ getInnermostLoopOrSwitch()

ShPtr< Statement > retdec::llvmir2hll::getInnermostLoopOrSwitch ( ShPtr< Statement stmt)

Returns the innermost loop or switch inside which stmt is.

If there is no innermost loop or switch, it returns the null pointer.

Preconditions
  • stmt is non-null

◆ getLhs()

ShPtr< Expression > retdec::llvmir2hll::getLhs ( ShPtr< Statement stmt)

Returns the left-hand side of the given variable definition/assign statement.

Precondition:

  • stmt is either a variable definition statement or an assign statement

◆ getNameOfCalledFunc()

std::string retdec::llvmir2hll::getNameOfCalledFunc ( ShPtr< CallExpr callExpr,
ShPtr< Module module 
)

Returns the name of the function called in call.

If the call is indirect, the empty string is returned.

◆ getOffsetFromName()

std::string retdec::llvmir2hll::getOffsetFromName ( const std::string &  name)

Returns the offset extracted from the given name.

Parameters
[in]nameName from which the offset should be extracted.

If the offset cannot be extracted, it returns the empty string.

Possible formats of names and their extracted offsets:

- xxx_-yy -> -yy
- xxx_+yy -> +yy
- xxx_yy -> +yy

◆ getRhs()

ShPtr< Expression > retdec::llvmir2hll::getRhs ( ShPtr< Statement stmt)

Returns the right-hand side of the given variable definition/assign statement.

Precondition:

  • stmt is either a variable definition statement or an assign statement

◆ id()

template<typename T >
T& retdec::llvmir2hll::id ( T &  object)

Returns object.

Template Parameters
TType of object.

◆ is8BitStringLiteral()

bool retdec::llvmir2hll::is8BitStringLiteral ( const llvm::ConstantArray *  ca)

Checks if the given LLVM constant array represents an 8-bit string literal.

◆ isa()

template<typename To , typename From >
bool retdec::llvmir2hll::isa ( const ShPtr< From > &  ptr)
noexcept

Returns true if ptr is of type To or can be casted from From to To, false otherwise.

Parameters
[in]ptrPointer to be tested.
Template Parameters
ToDesired output type.
FromInput type.

The purpose of this function is to provide a more concise notation. Indeed, isa<X>(ptr) is more concise than std::dynamic_pointer_cast<X>(ptr).

Furthermore,

if (isa<EmptyStmt>(stmt)) {

is more readable than

if (cast<EmptyStmt>(stmt)) {

◆ isCallByPointer()

bool retdec::llvmir2hll::isCallByPointer ( ShPtr< Expression callExpr,
ShPtr< Module module 
)

Returns true if the given call expression callExpr in the given module is indirect (by a pointer), false otherwise.

◆ isDefOfVar()

bool retdec::llvmir2hll::isDefOfVar ( ShPtr< Statement stmt,
ShPtr< Variable var 
)

Returns true if stmt defines var, false otherwise.

Preconditions
  • stmt and var are non-null

◆ isInfiniteEmptyLoop()

bool retdec::llvmir2hll::isInfiniteEmptyLoop ( ShPtr< WhileLoopStmt stmt)

Returns true if the given loop is both empty and infinite, false otherwise.

An infinite empty loop is of the following form:

while (true) {
// optional empty statements
}

◆ isLoop()

bool retdec::llvmir2hll::isLoop ( ShPtr< Statement stmt)

Returns true if stmt is a loop, false otherwise.

A loop can be either a for loop or a while loop.

◆ isLoopEnd()

bool retdec::llvmir2hll::isLoopEnd ( ShPtr< Statement stmt)

Returns true if stmt is the ending statement of a loop, false otherwise.

The ending statement is of the following form:

if cond:
either nothing or a variable assignment
break or return

Furhermore, none of the statements is a goto target.

◆ isVarDefOrAssignStmt()

bool retdec::llvmir2hll::isVarDefOrAssignStmt ( ShPtr< Statement stmt)

Returns true if stmt is a VarDefStmt or AssignStmt, false otherwise.

◆ isWhileTrueLoop()

bool retdec::llvmir2hll::isWhileTrueLoop ( ShPtr< WhileLoopStmt stmt)

Returns true if stmt is a while True loop, false otherwise.

◆ makeIdentifierValid()

std::string retdec::llvmir2hll::makeIdentifierValid ( const std::string &  id)

Replaces invalid characters by valid ones in the given identifier.

Invalid means that it cannot be a part of an identifier in any HLL. A single character may be replaced with several characters.

◆ operator<<() [1/2]

llvm::raw_ostream & retdec::llvmir2hll::operator<< ( llvm::raw_ostream &  os,
const ShPtr< Value > &  value 
)

Emits value into os.

◆ operator<<() [2/2]

std::ostream & retdec::llvmir2hll::operator<< ( std::ostream &  os,
Value value 
)

Emits value into os.

◆ REGISTER_AT_FACTORY() [1/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "address"  ,
ADDRESS_VAR_RENAMER_ID  ,
VarRenamerFactory  ,
AddressVarRenamer::create   
)

◆ REGISTER_AT_FACTORY() [2/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "APICall"  ,
API_CALL_PATTERN_FINDER_ID  ,
PatternFinderFactory  ,
APICallPatternFinder::create   
)

◆ REGISTER_AT_FACTORY() [3/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "APICallSeq"  ,
API_CALL_SEQ_PATTERN_FINDER_ID  ,
PatternFinderFactory  ,
APICallSeqPatternFinder::create   
)

◆ REGISTER_AT_FACTORY() [4/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "basic"  ,
BASIC_ALIAS_ANALYSIS_ID  ,
AliasAnalysisFactory  ,
BasicAliasAnalysis::create   
)

◆ REGISTER_AT_FACTORY() [5/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "BoolComparison"  ,
BOOL_COMPARISON_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
BoolComparisonSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [6/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "BreakOutsideLoop"  ,
BREAK_OUTSIDE_LOOP_VALIDATOR_ID  ,
ValidatorFactory  ,
BreakOutsideLoopValidator::create   
)

◆ REGISTER_AT_FACTORY() [7/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "c"  ,
C_ARITHM_EXPR_EVALUATOR_ID  ,
ArithmExprEvaluatorFactory  ,
CArithmExprEvaluator::create   
)

◆ REGISTER_AT_FACTORY() [8/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "c"  ,
C_HLL_WRITER_ID  ,
HLLWriterFactory  ,
CHLLWriter::create   
)

◆ REGISTER_AT_FACTORY() [9/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "ChangeOrderOfOperands"  ,
CHANGE_ORDER_OF_OPERANDS_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
ChangeOrderOfOperandsSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [10/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "ConstOperatorConst"  ,
CONST_OPERATOR_CONST_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
ConstOperatorConstSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [11/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "default"  ,
DEFAULT_SEMANTICS_ID  ,
SemanticsFactory  ,
DefaultSemantics::create   
)

◆ REGISTER_AT_FACTORY() [12/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "dot"  ,
GRAPHVIZ_CFG_WRITER_ID  ,
CFGWriterFactory  ,
GraphvizCFGWriter::create   
)

◆ REGISTER_AT_FACTORY() [13/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "dot"  ,
GRAPHVIZ_CG_WRITER_ID  ,
CGWriterFactory  ,
GraphvizCGWriter::create   
)

◆ REGISTER_AT_FACTORY() [14/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "EqualOperands"  ,
EQUAL_OPERANDS_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
EqualOperandsSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [15/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "fruit"  ,
FRUIT_VAR_NAME_GEN_ID  ,
VarNameGenFactory  ,
FruitVarNameGen::create   
)

◆ REGISTER_AT_FACTORY() [16/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "gcc-general"  ,
GCC_GENERAL_SEMANTICS_ID  ,
SemanticsFactory  ,
GCCGeneralSemantics::create   
)

◆ REGISTER_AT_FACTORY() [17/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "hungarian"  ,
HUNGARIAN_VAR_RENAMER_ID  ,
VarRenamerFactory  ,
HungarianVarRenamer::create   
)

◆ REGISTER_AT_FACTORY() [18/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "libc"  ,
LIBC_SEMANTICS_ID  ,
SemanticsFactory  ,
LibcSemantics::create   
)

◆ REGISTER_AT_FACTORY() [19/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "NegationOperator"  ,
NEGATION_OPERATOR_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
NegationOperatorSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [20/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "NegativeOperand"  ,
NEGATIVE_OPERAND_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
NegativeOperandSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [21/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "NoGlobalVarDef"  ,
NO_GLOBAL_VAR_DEF_VALIDATOR_ID  ,
ValidatorFactory  ,
NoGlobalVarDefValidator::create   
)

◆ REGISTER_AT_FACTORY() [22/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "num"  ,
NUM_VAR_NAME_GEN_ID  ,
VarNameGenFactory  ,
NumVarNameGen::create   
)

◆ REGISTER_AT_FACTORY() [23/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "One"  ,
ONE_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
OneSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [24/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "optim"  ,
OPTIM_CALL_INFO_OBTAINER_ID  ,
CallInfoObtainerFactory  ,
OptimCallInfoObtainer::create   
)

◆ REGISTER_AT_FACTORY() [25/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "pessim"  ,
PESSIM_CALL_INFO_OBTAINER_ID  ,
CallInfoObtainerFactory  ,
PessimCallInfoObtainer::create   
)

◆ REGISTER_AT_FACTORY() [26/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "readable"  ,
READABLE_VAR_RENAMER_ID  ,
VarRenamerFactory  ,
ReadableVarRenamer::create   
)

◆ REGISTER_AT_FACTORY() [27/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "Return"  ,
RETURN_VALIDATOR_ID  ,
ValidatorFactory  ,
ReturnValidator::create   
)

◆ REGISTER_AT_FACTORY() [28/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "simple"  ,
SIMPLE_ALIAS_ANALYSIS_ID  ,
AliasAnalysisFactory  ,
SimpleAliasAnalysis::create   
)

◆ REGISTER_AT_FACTORY() [29/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "simple"  ,
SIMPLE_VAR_RENAMER_ID  ,
VarRenamerFactory  ,
SimpleVarRenamer::create   
)

◆ REGISTER_AT_FACTORY() [30/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "strict"  ,
STRICT_ARITHM_EXPR_EVALUATOR_ID  ,
ArithmExprEvaluatorFactory  ,
StrictArithmExprEvaluator::create   
)

◆ REGISTER_AT_FACTORY() [31/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "TernaryOperator"  ,
TERNARY_OPERATOR_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
TernaryOperatorSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [32/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "ThreeOperands"  ,
OP_OPER_OP_OPER_OP_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
ThreeOperandsSubOptimizer::create   
)

◆ REGISTER_AT_FACTORY() [33/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "unified"  ,
UNIFIED_VAR_RENAMER_ID  ,
VarRenamerFactory  ,
UnifiedVarRenamer::create   
)

◆ REGISTER_AT_FACTORY() [34/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "win-api"  ,
WIN_API_SEMANTICS_ID  ,
SemanticsFactory  ,
WinAPISemantics::create   
)

◆ REGISTER_AT_FACTORY() [35/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "word"  ,
WORD_VAR_NAME_GEN_ID  ,
VarNameGenFactory  ,
WordVarNameGen::create   
)

◆ REGISTER_AT_FACTORY() [36/36]

retdec::llvmir2hll::REGISTER_AT_FACTORY ( "Zero"  ,
ZERO_SUB_OPTIMIZER_ID  ,
SubOptimizerFactory  ,
ZeroSubOptimizer::create   
)

◆ removeVarDefOrAssignStatement()

StmtVector retdec::llvmir2hll::removeVarDefOrAssignStatement ( ShPtr< Statement stmt,
ShPtr< Function func 
)

Removes the given variable definition/assignment statement.

Parameters
[in]stmtStatement to be removed.
[in]funcIf non-null and the removed statement is a variable definition statement, updates the set of local variables of the function.
Returns
A vector of statements (possibly empty) with which stmt has been replaced.

If there are function calls in the right-hand side of stmt, they are preserved, and returned in the resulting list. Debug comments are also preserved.

Precondition:

  • stmt is either a variable definition statement or an assign statement

◆ replaceVarWithExprInStmt()

void retdec::llvmir2hll::replaceVarWithExprInStmt ( ShPtr< Variable var,
ShPtr< Expression expr,
ShPtr< Statement stmt 
)

Replaces var with expr in stmt.

◆ skipAddresses()

ShPtr< Expression > retdec::llvmir2hll::skipAddresses ( ShPtr< Expression expr)

Skips addresses in the given expression and returns the first non-address expression.

◆ skipCasts()

ShPtr< Expression > retdec::llvmir2hll::skipCasts ( ShPtr< Expression expr)

Skips casts in the given expression and returns the first non-cast expression.

◆ skipDerefs()

ShPtr< Expression > retdec::llvmir2hll::skipDerefs ( ShPtr< Expression expr)

Skips dereferences in the given expression and returns the first non-dereference expression.

◆ skipEmptyStmts()

ShPtr< Statement > retdec::llvmir2hll::skipEmptyStmts ( ShPtr< Statement stmts)

Skips empty statements in stmt.

Parameters
[in]stmtsSequence of statements where empty statements should be skipped.
Returns
First non-empty statement in stmts.

If there is no non-empty statement in stmts, the null pointer is returned.

◆ sortByName() [1/3]

void retdec::llvmir2hll::sortByName ( FuncVector vec)

Sorts the given vector by the name of its elements (case-insensitively).

Note
This one function is defined outside the namespace below with explicit namespace declarations to help Doxygen and prevent it from generating "no matching file member found for" warnings.

◆ sortByName() [2/3]

void retdec::llvmir2hll::sortByName ( VarInitPairVector vec)

Sorts the given vector by the name of its elements (case-insensitively).

Only the name of a variable is considered.

◆ sortByName() [3/3]

void retdec::llvmir2hll::sortByName ( VarVector vec)

Sorts the given vector by the name of its elements (case-insensitively).

◆ splitWhileTrueLoop()

ShPtr< SplittedWhileTrueLoop > retdec::llvmir2hll::splitWhileTrueLoop ( ShPtr< WhileLoopStmt stmt,
ShPtr< IndVarInfo indVarInfo 
)

Splits the given "while True" loop stmt into three parts.

Parameters
[in]stmt"while True" loop to be splitted.
[in]indVarInfoSee the description of SplittedWhileTrueLoop for more details.

Each statement in the loop will be cloned by calling clone() on it.

If the loop either isn't a "while True" loop or it cannot be splitted into the three parts, the null pointer is returned.

◆ stores8BitStringLiteral()

bool retdec::llvmir2hll::stores8BitStringLiteral ( const llvm::GlobalVariable *  v)

Checks if the global variable stores an 8-bit string literal.

Preconditions
  • v is non-null

◆ toConstString() [1/2]

ShPtr< ConstString > retdec::llvmir2hll::toConstString ( llvm::ConstantArray *  ca)

Converts the given LLVM constant array into ConstString.

Preconditions
  • ca is non-null and represents a constant string

◆ toConstString() [2/2]

ShPtr< ConstString > retdec::llvmir2hll::toConstString ( llvm::ConstantDataArray *  cda)

Converts the given LLVM constant data array into ConstString.

Preconditions
  • cda is non-null and represents a constant string

◆ ucast()

template<typename To , typename From >
ShPtr<To> retdec::llvmir2hll::ucast ( const ShPtr< From > &  ptr)
noexcept

Equivalent of static_cast<> for shared pointers (unchecked cast).

Parameters
[in]ptrPointer to be casted.
Template Parameters
ToOutput type.
FromInput type.

The purpose of this function is to provide a more concise notation. Indeed, scast<X>(ptr) is more concise than std::static_pointer_cast<X>(ptr).

The name of this function template stems from the fact that it performs an unchecked cast, hence ucast.

◆ X()

static RegisterPass<LlvmIr2Hll> retdec::llvmir2hll::X ( "retdec-llvmir2hll"  ,
"LLVM IR -> HLL"  ,
false  ,
false   
)
static

Variable Documentation

◆ debug_enabled

const bool retdec::llvmir2hll::debug_enabled = false

◆ NO_ADDRESS_RANGE

const AddressRange retdec::llvmir2hll::NO_ADDRESS_RANGE = AddressRange(0, 0)

No address range.

◆ NO_LINE_RANGE

const LineRange retdec::llvmir2hll::NO_LINE_RANGE = LineRange(0, 0)

No line range.