Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / Transforms / Scalar / ScalarReplAggregates.cpp
index 5c49a5504b47659165a385462bd114fb49b9d0a0..d89a5bcd63a69ce2f4188b00e07c7b24520b5c31 100644 (file)
@@ -1032,8 +1032,7 @@ bool SROA::runOnFunction(Function &F) {
   if (skipOptnoneFunction(F))
     return false;
 
-  DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
-  DL = DLP ? &DLP->getDataLayout() : nullptr;
+  DL = &F.getParent()->getDataLayout();
 
   bool Changed = performPromotion(F);