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/AssignmentTrackingAnalysis.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp') diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index 535be6c..0eef93f 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -2184,7 +2184,7 @@ static AssignmentTrackingLowering::OverlapMap buildOverlapMapAndRecordDeclares( if (auto *DII = dyn_cast(&I)) { ProcessDbgRecord(DII, InstDeclares); } else if (auto Info = getUntaggedStoreAssignmentInfo( - I, Fn.getParent()->getDataLayout())) { + I, Fn.getDataLayout())) { // Find markers linked to this alloca. auto HandleDbgAssignForStore = [&](auto *Assign) { std::optional FragInfo; @@ -2800,7 +2800,7 @@ DebugAssignmentTrackingAnalysis::run(Function &F, if (!isAssignmentTrackingEnabled(*F.getParent())) return FunctionVarLocs(); - auto &DL = F.getParent()->getDataLayout(); + auto &DL = F.getDataLayout(); FunctionVarLocsBuilder Builder; analyzeFunction(F, DL, &Builder); -- cgit v1.1