[PATCH] D45926: Fix DISubprogram while extracting instructions out of function
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 26 10:14:41 PDT 2018
hiraditya added inline comments.
================
Comment at: include/llvm/Transforms/Utils/Cloning.h:132
+enum class CloneType {
+ InvalidCloneType,
----------------
aprantl wrote:
> aprantl wrote:
> > aprantl wrote:
> > > Can you please also add documentation to CloneFunctionInto that explains what the difference between those modes is?
> > `/// Used to control \p CloneFunctionInto.`
> ```
> /// Used to control \p CloneFunctionInto.
> enum class CloneType {
> InvalidCloneType,
> /// Cloning will result in module level changes.
> ModuleLevelChanges,
> /// What does this mean exactly? Do we even need it?
> NoModuleLevelChanges,
> /// Cloning will be used for extracting functions
> /// by passes like function merging, it does not require module level changes
> /// but debug info needs special treatment like: DISubprogram is not cloned.
> ExtractingFunctions,
> };
> ```
> What does this mean exactly? Do we even need it?
This is used in cases when we dont want module level changes but it is not used for extracting functions. I did not want to modify the behavior at other places so introduced this for example: calls to CloneFunctionInto in Cloning.cpp. Perhaps we can merge ExtractingFunctions with NoModuleLevelChanges but I'm not very sure.
https://reviews.llvm.org/D45926
More information about the llvm-commits
mailing list