From 9df71d7673b5c98e1032d01be83724a45b42fafc Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 28 Jun 2024 08:36:49 +0200 Subject: [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. --- llvm/lib/CodeGen/MachineFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 4182e75..7f6a752 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -307,7 +307,7 @@ void MachineFunction::clear() { } const DataLayout &MachineFunction::getDataLayout() const { - return F.getParent()->getDataLayout(); + return F.getDataLayout(); } /// Get the JumpTableInfo for this function. -- cgit v1.1