Skip to content

Commit

Permalink
Add a type map into the code that moves constants and types. Also, ad…
Browse files Browse the repository at this point in the history
…d additional support for unary/binary operators. (#563)
  • Loading branch information
Peter Goodman authored Nov 30, 2021
1 parent 905f75d commit e24243c
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 164 deletions.
3 changes: 2 additions & 1 deletion include/remill/BC/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ llvm::IntegerType *AddressType(llvm::Module *module)
__attribute__((deprecated));

using ValueMap = std::unordered_map<llvm::Value *, llvm::Value *>;
using TypeMap = std::unordered_map<llvm::Type *, llvm::Type *>;
using MDMap = std::unordered_map<llvm::Metadata *, llvm::Metadata *>;

// Clone function `source_func` into `dest_func`, using `value_map` to map over
Expand All @@ -232,7 +233,7 @@ using MDMap = std::unordered_map<llvm::Metadata *, llvm::Metadata *>;
// Note: this will try to clone globals referenced from the module of
// `source_func` into the module of `dest_func`.
void CloneFunctionInto(llvm::Function *source_func, llvm::Function *dest_func,
ValueMap &value_map, MDMap &md_map);
ValueMap &value_map, TypeMap &type_map, MDMap &md_map);

// Clone function `source_func` into `dest_func`. This will strip out debug
// info during the clone.
Expand Down
Loading

0 comments on commit e24243c

Please sign in to comment.