From 339430f9935c4d3bb620f5e63be7ea3a7b3ea5ae Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 25 Feb 2014 23:25:17 +0000 Subject: Use DataLayout from the module when easily available. Eventually DataLayoutPass should go away, but for now that is the only easy way to get a DataLayout in some APIs. This patch only changes the ones that have easy access to a Module. One interesting issue with sometimes using DataLayoutPass and sometimes fetching it from the Module is that we have to make sure they are equivalent. We can get most of the way there by always constructing the pass with a Module. In fact, the pass could be changed to point to an external DataLayout instead of owning one to make this stricter. Unfortunately, the C api passes a DataLayout, so it has to be up to the caller to make sure the pass and the module are in sync. llvm-svn: 202204 --- llvm/lib/IR/DataLayout.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'llvm/lib/IR/DataLayout.cpp') diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index ccdaec5e554..bddb6807512 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -786,10 +786,6 @@ DataLayoutPass::DataLayoutPass(const DataLayout &DL) initializeDataLayoutPassPass(*PassRegistry::getPassRegistry()); } -DataLayoutPass::DataLayoutPass(StringRef Str) : ImmutablePass(ID), DL(Str) { - initializeDataLayoutPassPass(*PassRegistry::getPassRegistry()); -} - DataLayoutPass::DataLayoutPass(const Module *M) : ImmutablePass(ID), DL(M) { initializeDataLayoutPassPass(*PassRegistry::getPassRegistry()); } -- cgit v1.2.3