diff options
author | James Molloy <james.molloy@arm.com> | 2013-05-28 15:17:05 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2013-05-28 15:17:05 +0000 |
commit | a84a83bbcdfaecadfc6574094272fd3edc429a23 (patch) | |
tree | ca87000d15263653ac635164ab194745b87f46e6 /lib/Transforms/Utils/CloneFunction.cpp | |
parent | 9903f75bf6ec4136bd752595c689db845eedad3d (diff) | |
download | external_llvm-a84a83bbcdfaecadfc6574094272fd3edc429a23.tar.gz external_llvm-a84a83bbcdfaecadfc6574094272fd3edc429a23.tar.bz2 external_llvm-a84a83bbcdfaecadfc6574094272fd3edc429a23.zip |
Extend RemapInstruction and friends to take an optional new parameter, a ValueMaterializer.
Extend LinkModules to pass a ValueMaterializer to RemapInstruction and friends to lazily create Functions for lazily linked globals. This is a big win when linking small modules with large (mostly unused) library modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | lib/Transforms/Utils/CloneFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index be8d39e128..d105f5e24a 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -78,7 +78,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, bool ModuleLevelChanges, SmallVectorImpl<ReturnInst*> &Returns, const char *NameSuffix, ClonedCodeInfo *CodeInfo, - ValueMapTypeRemapper *TypeMapper) { + ValueMapTypeRemapper *TypeMapper, + ValueMaterializer *Materializer) { assert(NameSuffix && "NameSuffix cannot be null!"); #ifndef NDEBUG @@ -147,7 +148,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II) RemapInstruction(II, VMap, ModuleLevelChanges ? RF_None : RF_NoModuleLevelChanges, - TypeMapper); + TypeMapper, Materializer); } /// CloneFunction - Return a copy of the specified function, but without |