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/IR/DebugInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/IR/DebugInfo.cpp') diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index e57c3fe..7f1489e 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -2271,7 +2271,7 @@ bool AssignmentTrackingPass::runOnFunction(Function &F) { return /*Changed*/ false; bool Changed = false; - auto *DL = &F.getParent()->getDataLayout(); + auto *DL = &F.getDataLayout(); // Collect a map of {backing storage : dbg.declares} (currently "backing // storage" is limited to Allocas). We'll use this to find dbg.declares to // delete after running `trackAssignments`. -- cgit v1.1