From 75c7bca740935a0cca462e28475dd6b046a6872c Mon Sep 17 00:00:00 2001 From: Sergei Barannikov Date: Tue, 13 Aug 2024 04:00:19 +0300 Subject: [DataLayout] Remove constructor accepting a pointer to Module (#102841) The constructor initializes `*this` with `M->getDataLayout()`, which is effectively the same as calling the copy constructor. There does not seem to be a case where a copy would be necessary. Pull Request: https://github.com/llvm/llvm-project/pull/102841 --- llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp') diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index 146276b..788cdfe 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -2826,13 +2826,12 @@ bool AssignmentTrackingAnalysis::runOnFunction(Function &F) { LLVM_DEBUG(dbgs() << "AssignmentTrackingAnalysis run on " << F.getName() << "\n"); - auto DL = std::make_unique(F.getParent()); // Clear previous results. Results->clear(); FunctionVarLocsBuilder Builder; - analyzeFunction(F, *DL.get(), &Builder); + analyzeFunction(F, F.getDataLayout(), &Builder); // Save these results. Results->init(Builder); -- cgit v1.1