Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / Transforms / Scalar / Scalarizer.cpp
index 6036c099be0eafbb5c3e4101ef8a1f725adfa021..5638d20075d11e28ffcc28573fc62a3626ee88c5 100644 (file)
@@ -248,8 +248,7 @@ bool Scalarizer::doInitialization(Module &M) {
 }
 
 bool Scalarizer::runOnFunction(Function &F) {
-  DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
-  DL = DLP ? &DLP->getDataLayout() : nullptr;
+  DL = &F.getParent()->getDataLayout();
   for (Function::iterator BBI = F.begin(), BBE = F.end(); BBI != BBE; ++BBI) {
     BasicBlock *BB = BBI;
     for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE;) {