aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/StackSafetyAnalysis.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/Analysis/StackSafetyAnalysis.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/Analysis/StackSafetyAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/StackSafetyAnalysis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
index c700d80..27360d0 100644
--- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp
+++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
@@ -268,7 +268,7 @@ class StackSafetyLocalAnalysis {
public:
StackSafetyLocalAnalysis(Function &F, ScalarEvolution &SE)
- : F(F), DL(F.getParent()->getDataLayout()), SE(SE),
+ : F(F), DL(F.getDataLayout()), SE(SE),
PointerSize(DL.getPointerSizeInBits()),
UnknownRange(PointerSize, true) {}
@@ -852,7 +852,7 @@ GVToSSI createGlobalStackSafetyInfo(
}
uint32_t PointerSize =
- Copy.begin()->first->getParent()->getDataLayout().getPointerSizeInBits();
+ Copy.begin()->first->getDataLayout().getPointerSizeInBits();
StackSafetyDataFlowAnalysis<GlobalValue> SSDFA(PointerSize, std::move(Copy));
for (const auto &F : SSDFA.run()) {