[PATCH] D61554: [llvm] Add CloneModuleInto to clone a Module into another one, a la assignment

Don Hinton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 4 14:34:55 PDT 2019


hintonda created this revision.
hintonda added reviewers: pcc, lattner.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

The Module class contains an LLVMContext& member, which
prevents assignment.  This technique uses placement new and passed the
new instance to the existing CloneModule functions to accomplish the
same thing.

This is useful in passes that want to clone the Module, prospectively
modify it, then decide whether or not to keep the changes, e.g.,
bugpoint type reduction passes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61554

Files:
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/Transforms/Utils/CloneModule.cpp
  llvm/unittests/Transforms/Utils/CloningTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61554.198149.patch
Type: text/x-patch
Size: 4428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190504/a4395997/attachment.bin>


More information about the llvm-commits mailing list