class ReturnInst;
/// Return an exact copy of the specified module
-///
std::unique_ptr<Module> CloneModule(const Module &M);
std::unique_ptr<Module> CloneModule(const Module &M, ValueToValueMapTy &VMap);
CloneModule(const Module &M, ValueToValueMapTy &VMap,
function_ref<bool(const GlobalValue *)> ShouldCloneDefinition);
-/// ClonedCodeInfo - This struct can be used to capture information about code
+/// This struct can be used to capture information about code
/// being cloned, while it is being cloned.
struct ClonedCodeInfo {
- /// ContainsCalls - This is set to true if the cloned code contains a normal
- /// call instruction.
+ /// This is set to true if the cloned code contains a normal call instruction.
bool ContainsCalls = false;
- /// ContainsDynamicAllocas - This is set to true if the cloned code contains
- /// a 'dynamic' alloca. Dynamic allocas are allocas that are either not in
- /// the entry block or they are in the entry block but are not a constant
- /// size.
+ /// This is set to true if the cloned code contains a 'dynamic' alloca.
+ /// Dynamic allocas are allocas that are either not in the entry block or they
+ /// are in the entry block but are not a constant size.
bool ContainsDynamicAllocas = false;
/// All cloned call sites that have operand bundles attached are appended to
ClonedCodeInfo() = default;
};
-/// CloneBasicBlock - Return a copy of the specified basic block, but without
+/// Return a copy of the specified basic block, but without
/// embedding the block into a particular function. The block returned is an
/// exact copy of the specified basic block, without any remapping having been
/// performed. Because of this, this is only suitable for applications where
/// If you would like to collect additional information about the cloned
/// function, you can specify a ClonedCodeInfo object with the optional fifth
/// parameter.
-///
BasicBlock *CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap,
const Twine &NameSuffix = "", Function *F = nullptr,
ClonedCodeInfo *CodeInfo = nullptr,
DebugInfoFinder *DIFinder = nullptr);
-/// CloneFunction - Return a copy of the specified function and add it to that
+/// Return a copy of the specified function and add it to that
/// function's module. Also, any references specified in the VMap are changed
/// to refer to their mapped value instead of the original one. If any of the
/// arguments to the function are in the VMap, the arguments are deleted from
const char *NameSuffix = "",
ClonedCodeInfo *CodeInfo = nullptr);
-/// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto,
+/// This works exactly like CloneFunctionInto,
/// except that it does some simple constant prop and DCE on the fly. The
/// effect of this is to copy significantly less code in cases where (for
/// example) a function call with constant arguments is inlined, and those
ClonedCodeInfo *CodeInfo = nullptr,
Instruction *TheCall = nullptr);
-/// InlineFunctionInfo - This class captures the data input to the
-/// InlineFunction call, and records the auxiliary results produced by it.
+/// This class captures the data input to the InlineFunction call, and records
+/// the auxiliary results produced by it.
class InlineFunctionInfo {
public:
explicit InlineFunctionInfo(CallGraph *cg = nullptr,
: CG(cg), GetAssumptionCache(GetAssumptionCache), PSI(PSI),
CallerBFI(CallerBFI), CalleeBFI(CalleeBFI) {}
- /// CG - If non-null, InlineFunction will update the callgraph to reflect the
+ /// If non-null, InlineFunction will update the callgraph to reflect the
/// changes it makes.
CallGraph *CG;
std::function<AssumptionCache &(Function &)> *GetAssumptionCache;
ProfileSummaryInfo *PSI;
BlockFrequencyInfo *CallerBFI, *CalleeBFI;
- /// StaticAllocas - InlineFunction fills this in with all static allocas that
- /// get copied into the caller.
+ /// InlineFunction fills this in with all static allocas that get copied into
+ /// the caller.
SmallVector<AllocaInst *, 4> StaticAllocas;
- /// InlinedCalls - InlineFunction fills this in with callsites that were
- /// inlined from the callee. This is only filled in if CG is non-null.
+ /// InlineFunction fills this in with callsites that were inlined from the
+ /// callee. This is only filled in if CG is non-null.
SmallVector<WeakTrackingVH, 8> InlinedCalls;
/// All of the new call sites inlined into the caller.
}
};
-/// InlineFunction - This function inlines the called function into the basic
+/// This function inlines the called function into the basic
/// block of the caller. This returns false if it is not possible to inline
/// this call. The program is still in a well defined state if this occurs
/// though.