From 935125126c4ffde74ef3a82959fde69ee8c6b648 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 25 Feb 2014 17:30:31 +0000 Subject: Make DataLayout a plain object, not a pass. Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM don't don't handle passes to also use DataLayout. llvm-svn: 202168 --- llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp') diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index bbe63c99505..b925cd235c9 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -172,7 +172,8 @@ bool CFGSimplifyPass::runOnFunction(Function &F) { return false; const TargetTransformInfo &TTI = getAnalysis(); - const DataLayout *DL = getAnalysisIfAvailable(); + DataLayoutPass *DLP = getAnalysisIfAvailable(); + const DataLayout *DL = DLP ? &DLP->getDataLayout() : 0; bool EverChanged = removeUnreachableBlocks(F); EverChanged |= mergeEmptyReturnBlocks(F); EverChanged |= iterativelySimplifyCFG(F, TTI, DL); -- cgit v1.2.3