From 2d209d964a17687f70299d756a7b5e9fa342e0b4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 27 Jun 2024 16:38:15 +0200 Subject: [IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902) This is a helper to avoid writing `getModule()->getDataLayout()`. I regularly try to use this method only to remember it doesn't exist... `getModule()->getDataLayout()` is also a common (the most common?) reason why code has to include the Module.h header. --- llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp') diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index b340771..535be6c 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -2192,7 +2192,7 @@ static AssignmentTrackingLowering::OverlapMap buildOverlapMapAndRecordDeclares( // Skip this assignment if the affected bits are outside of the // variable fragment. if (!at::calculateFragmentIntersect( - I.getModule()->getDataLayout(), Info->Base, + I.getDataLayout(), Info->Base, Info->OffsetInBits, Info->SizeInBits, Assign, FragInfo) || (FragInfo && FragInfo->SizeInBits == 0)) return; -- cgit v1.1