[FunctionAttrs] Move the malloc-like test to a static helper function
[oota-llvm.git] / lib / Transforms / Utils / SimplifyInstructions.cpp
index 55a4455b98524fcb6e16c17b8de251c9c285e726..c499c87b1f0bd6a45b29da0596686e47d721c5f4 100644 (file)
@@ -51,8 +51,7 @@ namespace {
       const DominatorTreeWrapperPass *DTWP =
           getAnalysisIfAvailable<DominatorTreeWrapperPass>();
       const DominatorTree *DT = DTWP ? &DTWP->getDomTree() : nullptr;
-      DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
-      const DataLayout *DL = DLP ? &DLP->getDataLayout() : nullptr;
+      const DataLayout &DL = F.getParent()->getDataLayout();
       const TargetLibraryInfo *TLI =
           &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
       AssumptionCache *AC =