[llvm] r272513 - Move instances of std::function.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 12 09:13:55 PDT 2016
Author: d0k
Date: Sun Jun 12 11:13:55 2016
New Revision: 272513
URL: http://llvm.org/viewvc/llvm-project?rev=272513&view=rev
Log:
Move instances of std::function.
Or replace with llvm::function_ref if it's never stored. NFC intended.
Modified:
llvm/trunk/include/llvm/LTO/LTO.h
llvm/trunk/include/llvm/Support/Printable.h
llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
llvm/trunk/include/llvm/Transforms/Utils/SplitModule.h
llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp
llvm/trunk/lib/CodeGen/IfConversion.cpp
llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp
llvm/trunk/lib/LTO/LTO.cpp
llvm/trunk/lib/Linker/IRMover.cpp
llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.h
llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h
llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp
llvm/trunk/lib/Transforms/Utils/CloneModule.cpp
llvm/trunk/lib/Transforms/Utils/SplitModule.cpp
Modified: llvm/trunk/include/llvm/LTO/LTO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTO.h?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTO.h (original)
+++ llvm/trunk/include/llvm/LTO/LTO.h Sun Jun 12 11:13:55 2016
@@ -58,10 +58,10 @@ public:
/// emit a copy), and compile-time optimization (allow drop of duplicates).
void thinLTOResolveWeakForLinkerInIndex(
ModuleSummaryIndex &Index,
- std::function<bool(GlobalValue::GUID, const GlobalValueSummary *)>
+ function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
isPrevailing,
- std::function<bool(StringRef, GlobalValue::GUID)> isExported,
- std::function<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported,
+ function_ref<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
recordNewLinkage);
/// Update the linkages in the given \p Index to mark exported values
@@ -69,8 +69,7 @@ void thinLTOResolveWeakForLinkerInIndex(
/// must apply the changes to the Module via thinLTOInternalizeModule.
void thinLTOInternalizeAndPromoteInIndex(
ModuleSummaryIndex &Index,
- std::function<bool(StringRef, GlobalValue::GUID)> isExported);
-
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported);
}
#endif
Modified: llvm/trunk/include/llvm/Support/Printable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Printable.h?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Printable.h (original)
+++ llvm/trunk/include/llvm/Support/Printable.h Sun Jun 12 11:13:55 2016
@@ -39,7 +39,7 @@ class Printable {
public:
std::function<void(raw_ostream &OS)> Print;
Printable(const std::function<void(raw_ostream &OS)> Print)
- : Print(Print) {}
+ : Print(std::move(Print)) {}
};
static inline raw_ostream &operator<<(raw_ostream &OS, const Printable &P) {
Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h Sun Jun 12 11:13:55 2016
@@ -59,7 +59,7 @@ std::unique_ptr<Module> CloneModule(cons
/// in place of the global definition.
std::unique_ptr<Module>
CloneModule(const Module *M, ValueToValueMapTy &VMap,
- std::function<bool(const GlobalValue *)> ShouldCloneDefinition);
+ function_ref<bool(const GlobalValue *)> ShouldCloneDefinition);
/// ClonedCodeInfo - This struct can be used to capture information about code
/// being cloned, while it is being cloned.
Modified: llvm/trunk/include/llvm/Transforms/Utils/SplitModule.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SplitModule.h?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/SplitModule.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/SplitModule.h Sun Jun 12 11:13:55 2016
@@ -16,7 +16,7 @@
#ifndef LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
#define LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
-#include <functional>
+#include "llvm/ADT/STLExtras.h"
#include <memory>
namespace llvm {
@@ -36,7 +36,7 @@ class StringRef;
/// each partition.
void SplitModule(
std::unique_ptr<Module> M, unsigned N,
- std::function<void(std::unique_ptr<Module> MPart)> ModuleCallback,
+ function_ref<void(std::unique_ptr<Module> MPart)> ModuleCallback,
bool PreserveLocals = false);
} // End llvm namespace
Modified: llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/AtomicExpandPass.cpp Sun Jun 12 11:13:55 2016
@@ -59,7 +59,7 @@ namespace {
bool tryExpandAtomicRMW(AtomicRMWInst *AI);
bool expandAtomicOpToLLSC(
Instruction *I, Value *Addr, AtomicOrdering MemOpOrder,
- std::function<Value *(IRBuilder<> &, Value *)> PerformOp);
+ function_ref<Value *(IRBuilder<> &, Value *)> PerformOp);
AtomicCmpXchgInst *convertCmpXchgToIntegerType(AtomicCmpXchgInst *CI);
bool expandAtomicCmpXchg(AtomicCmpXchgInst *CI);
bool isIdempotentRMW(AtomicRMWInst *AI);
@@ -514,7 +514,7 @@ bool AtomicExpand::tryExpandAtomicRMW(At
bool AtomicExpand::expandAtomicOpToLLSC(
Instruction *I, Value *Addr, AtomicOrdering MemOpOrder,
- std::function<Value *(IRBuilder<> &, Value *)> PerformOp) {
+ function_ref<Value *(IRBuilder<> &, Value *)> PerformOp) {
BasicBlock *BB = I->getParent();
Function *F = BB->getParent();
LLVMContext &Ctx = F->getContext();
Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IfConversion.cpp (original)
+++ llvm/trunk/lib/CodeGen/IfConversion.cpp Sun Jun 12 11:13:55 2016
@@ -1840,5 +1840,5 @@ void IfConverter::MergeBlocks(BBInfo &To
FunctionPass *
llvm::createIfConverter(std::function<bool(const Function &)> Ftor) {
- return new IfConverter(Ftor);
+ return new IfConverter(std::move(Ftor));
}
Modified: llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp Sun Jun 12 11:13:55 2016
@@ -79,7 +79,7 @@ bool UnpackMachineBundles::runOnMachineF
FunctionPass *
llvm::createUnpackMachineBundles(std::function<bool(const Function &)> Ftor) {
- return new UnpackMachineBundles(Ftor);
+ return new UnpackMachineBundles(std::move(Ftor));
}
namespace {
Modified: llvm/trunk/lib/LTO/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTO.cpp (original)
+++ llvm/trunk/lib/LTO/LTO.cpp Sun Jun 12 11:13:55 2016
@@ -43,10 +43,10 @@ std::unique_ptr<Module> loadModuleFromBu
static void thinLTOResolveWeakForLinkerGUID(
GlobalValueSummaryList &GVSummaryList, GlobalValue::GUID GUID,
DenseSet<GlobalValueSummary *> &GlobalInvolvedWithAlias,
- std::function<bool(GlobalValue::GUID, const GlobalValueSummary *)>
+ function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
isPrevailing,
- std::function<bool(StringRef, GlobalValue::GUID)> isExported,
- std::function<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported,
+ function_ref<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
recordNewLinkage) {
auto HasMultipleCopies = GVSummaryList.size() > 1;
@@ -87,10 +87,10 @@ static void thinLTOResolveWeakForLinkerG
// one copy.
void thinLTOResolveWeakForLinkerInIndex(
ModuleSummaryIndex &Index,
- std::function<bool(GlobalValue::GUID, const GlobalValueSummary *)>
+ function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
isPrevailing,
- std::function<bool(StringRef, GlobalValue::GUID)> isExported,
- std::function<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported,
+ function_ref<void(StringRef, GlobalValue::GUID, GlobalValue::LinkageTypes)>
recordNewLinkage) {
if (Index.modulePaths().size() == 1)
// Nothing to do if we don't have multiple modules
@@ -112,7 +112,7 @@ void thinLTOResolveWeakForLinkerInIndex(
static void thinLTOInternalizeAndPromoteGUID(
GlobalValueSummaryList &GVSummaryList, GlobalValue::GUID GUID,
- std::function<bool(StringRef, GlobalValue::GUID)> isExported) {
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported) {
for (auto &S : GVSummaryList) {
if (isExported(S->modulePath(), GUID)) {
if (GlobalValue::isLocalLinkage(S->linkage()))
@@ -126,7 +126,7 @@ static void thinLTOInternalizeAndPromote
// as external and non-exported values as internal.
void thinLTOInternalizeAndPromoteInIndex(
ModuleSummaryIndex &Index,
- std::function<bool(StringRef, GlobalValue::GUID)> isExported) {
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported) {
for (auto &I : Index)
thinLTOInternalizeAndPromoteGUID(I.second, I.first, isExported);
}
Modified: llvm/trunk/lib/Linker/IRMover.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/IRMover.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/IRMover.cpp (original)
+++ llvm/trunk/lib/Linker/IRMover.cpp Sun Jun 12 11:13:55 2016
@@ -1342,7 +1342,7 @@ Error IRMover::move(
std::unique_ptr<Module> Src, ArrayRef<GlobalValue *> ValuesToLink,
std::function<void(GlobalValue &, ValueAdder Add)> AddLazyFor) {
IRLinker TheIRLinker(Composite, SharedMDs, IdentifiedStructTypes,
- std::move(Src), ValuesToLink, AddLazyFor);
+ std::move(Src), ValuesToLink, std::move(AddLazyFor));
Error E = TheIRLinker.run();
Composite.dropTriviallyDeadConstantArrays();
return E;
Modified: llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp Sun Jun 12 11:13:55 2016
@@ -112,8 +112,8 @@ void GCNHazardRecognizer::RecedeCycle()
// Helper Functions
//===----------------------------------------------------------------------===//
-int GCNHazardRecognizer::getWaitStatesSinceDef(unsigned Reg,
- std::function<bool(MachineInstr*)> IsHazardDef ) {
+int GCNHazardRecognizer::getWaitStatesSinceDef(
+ unsigned Reg, function_ref<bool(MachineInstr *)> IsHazardDef) {
const TargetRegisterInfo *TRI =
MF.getSubtarget<AMDGPUSubtarget>().getRegisterInfo();
Modified: llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.h?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.h Sun Jun 12 11:13:55 2016
@@ -14,8 +14,8 @@
#ifndef LLVM_LIB_TARGET_AMDGPUHAZARDRECOGNIZERS_H
#define LLVM_LIB_TARGET_AMDGPUHAZARDRECOGNIZERS_H
+#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/ScheduleHazardRecognizer.h"
-#include <functional>
#include <list>
namespace llvm {
@@ -35,8 +35,8 @@ class GCNHazardRecognizer final : public
const MachineFunction &MF;
int getWaitStatesSinceDef(unsigned Reg,
- std::function<bool(MachineInstr*)> IsHazardDef =
- [](MachineInstr*) {return true;});
+ function_ref<bool(MachineInstr *)> IsHazardDef =
+ [](MachineInstr *) { return true; });
int checkSMEMSoftClauseHazards(MachineInstr *SMEM);
int checkSMRDHazards(MachineInstr *SMRD);
Modified: llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp Sun Jun 12 11:13:55 2016
@@ -1098,5 +1098,5 @@ bool Thumb2SizeReduce::runOnMachineFunct
/// reduction pass.
FunctionPass *llvm::createThumb2SizeReductionPass(
std::function<bool(const Function &)> Ftor) {
- return new Thumb2SizeReduce(Ftor);
+ return new Thumb2SizeReduce(std::move(Ftor));
}
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp Sun Jun 12 11:13:55 2016
@@ -98,7 +98,7 @@ void MipsTargetStreamer::emitDirectiveSe
void MipsTargetStreamer::emitDirectiveSetNoDsp() { forbidModuleDirective(); }
void MipsTargetStreamer::emitDirectiveCpLoad(unsigned RegNo) {}
bool MipsTargetStreamer::emitDirectiveCpRestore(
- int Offset, std::function<unsigned()> GetATReg, SMLoc IDLoc,
+ int Offset, function_ref<unsigned()> GetATReg, SMLoc IDLoc,
const MCSubtargetInfo *STI) {
forbidModuleDirective();
return true;
@@ -229,7 +229,7 @@ void MipsTargetStreamer::emitGPRestore(i
/// Emit a store instruction with an immediate offset.
void MipsTargetStreamer::emitStoreWithImmOffset(
unsigned Opcode, unsigned SrcReg, unsigned BaseReg, int64_t Offset,
- std::function<unsigned()> GetATReg, SMLoc IDLoc,
+ function_ref<unsigned()> GetATReg, SMLoc IDLoc,
const MCSubtargetInfo *STI) {
if (isInt<16>(Offset)) {
emitRRI(Opcode, SrcReg, BaseReg, Offset, IDLoc, STI);
@@ -586,7 +586,7 @@ void MipsTargetAsmStreamer::emitDirectiv
}
bool MipsTargetAsmStreamer::emitDirectiveCpRestore(
- int Offset, std::function<unsigned()> GetATReg, SMLoc IDLoc,
+ int Offset, function_ref<unsigned()> GetATReg, SMLoc IDLoc,
const MCSubtargetInfo *STI) {
MipsTargetStreamer::emitDirectiveCpRestore(Offset, GetATReg, IDLoc, STI);
OS << "\t.cprestore\t" << Offset << "\n";
@@ -1049,7 +1049,7 @@ void MipsTargetELFStreamer::emitDirectiv
}
bool MipsTargetELFStreamer::emitDirectiveCpRestore(
- int Offset, std::function<unsigned()> GetATReg, SMLoc IDLoc,
+ int Offset, function_ref<unsigned()> GetATReg, SMLoc IDLoc,
const MCSubtargetInfo *STI) {
MipsTargetStreamer::emitDirectiveCpRestore(Offset, GetATReg, IDLoc, STI);
// .cprestore offset
Modified: llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h Sun Jun 12 11:13:55 2016
@@ -13,10 +13,10 @@
#include "MCTargetDesc/MipsABIFlagsSection.h"
#include "MCTargetDesc/MipsABIInfo.h"
#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/MC/MCELFStreamer.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
-#include <functional>
namespace llvm {
@@ -84,7 +84,7 @@ public:
// PIC support
virtual void emitDirectiveCpLoad(unsigned RegNo);
virtual bool emitDirectiveCpRestore(int Offset,
- std::function<unsigned()> GetATReg,
+ function_ref<unsigned()> GetATReg,
SMLoc IDLoc, const MCSubtargetInfo *STI);
virtual void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,
const MCSymbol &Sym, bool IsReg);
@@ -133,7 +133,7 @@ public:
/// by reporting an error).
void emitStoreWithImmOffset(unsigned Opcode, unsigned SrcReg,
unsigned BaseReg, int64_t Offset,
- std::function<unsigned()> GetATReg, SMLoc IDLoc,
+ function_ref<unsigned()> GetATReg, SMLoc IDLoc,
const MCSubtargetInfo *STI);
void emitStoreWithSymOffset(unsigned Opcode, unsigned SrcReg,
unsigned BaseReg, MCOperand &HiOperand,
@@ -255,7 +255,7 @@ public:
/// temporary and is only called when the assembler temporary is required. It
/// must handle the case where no assembler temporary is available (typically
/// by reporting an error).
- bool emitDirectiveCpRestore(int Offset, std::function<unsigned()> GetATReg,
+ bool emitDirectiveCpRestore(int Offset, function_ref<unsigned()> GetATReg,
SMLoc IDLoc, const MCSubtargetInfo *STI) override;
void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,
const MCSymbol &Sym, bool IsReg) override;
@@ -311,7 +311,7 @@ public:
// PIC support
void emitDirectiveCpLoad(unsigned RegNo) override;
- bool emitDirectiveCpRestore(int Offset, std::function<unsigned()> GetATReg,
+ bool emitDirectiveCpRestore(int Offset, function_ref<unsigned()> GetATReg,
SMLoc IDLoc, const MCSubtargetInfo *STI) override;
void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,
const MCSymbol &Sym, bool IsReg) override;
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Sun Jun 12 11:13:55 2016
@@ -241,5 +241,5 @@ INITIALIZE_PASS_END(CFGSimplifyPass, "si
FunctionPass *
llvm::createCFGSimplificationPass(int Threshold,
std::function<bool(const Function &)> Ftor) {
- return new CFGSimplifyPass(Threshold, Ftor);
+ return new CFGSimplifyPass(Threshold, std::move(Ftor));
}
Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Sun Jun 12 11:13:55 2016
@@ -38,7 +38,7 @@ std::unique_ptr<Module> llvm::CloneModul
std::unique_ptr<Module> llvm::CloneModule(
const Module *M, ValueToValueMapTy &VMap,
- std::function<bool(const GlobalValue *)> ShouldCloneDefinition) {
+ function_ref<bool(const GlobalValue *)> ShouldCloneDefinition) {
// First off, we need to create the new module.
std::unique_ptr<Module> New =
llvm::make_unique<Module>(M->getModuleIdentifier(), M->getContext());
Modified: llvm/trunk/lib/Transforms/Utils/SplitModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SplitModule.cpp?rev=272513&r1=272512&r2=272513&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SplitModule.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SplitModule.cpp Sun Jun 12 11:13:55 2016
@@ -227,7 +227,7 @@ static bool isInPartition(const GlobalVa
void llvm::SplitModule(
std::unique_ptr<Module> M, unsigned N,
- std::function<void(std::unique_ptr<Module> MPart)> ModuleCallback,
+ function_ref<void(std::unique_ptr<Module> MPart)> ModuleCallback,
bool PreserveLocals) {
if (!PreserveLocals) {
for (Function &F : *M)
More information about the llvm-commits
mailing list