aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-28 08:36:49 +0200
committerGitHub <noreply@github.com>2024-06-28 08:36:49 +0200
commit9df71d7673b5c98e1032d01be83724a45b42fafc (patch)
treecf5f0c837110b4a753e71b0532d8e5ee6d487411 /llvm/lib/Transforms/Utils/CloneFunction.cpp
parent519e0bb094bd9444b64ac62f2e8192543fdb94b9 (diff)
downloadllvm-9df71d7673b5c98e1032d01be83724a45b42fafc.zip
llvm-9df71d7673b5c98e1032d01be83724a45b42fafc.tar.gz
llvm-9df71d7673b5c98e1032d01be83724a45b42fafc.tar.bz2
[IR] Add getDataLayout() helpers to Function and GlobalValue (#96919)
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds `getDataLayout()` helpers to Function and GlobalValue, replacing the current `getParent()->getDataLayout()` pattern.
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index bc432d6..47e3c03 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -818,7 +818,7 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
// As phi-nodes have been now remapped, allow incremental simplification of
// newly-cloned instructions.
- const DataLayout &DL = NewFunc->getParent()->getDataLayout();
+ const DataLayout &DL = NewFunc->getDataLayout();
for (const auto &BB : *OldFunc) {
for (const auto &I : BB) {
auto *NewI = dyn_cast_or_null<Instruction>(VMap.lookup(&I));