Make DataLayout a plain object, not a pass.
[oota-llvm.git] / lib / Transforms / IPO / ConstantMerge.cpp
index 0f49c7e1ec94853719ff0de64f16db1ccaec4648..6a32db966881c1545254a8eb1b749894949b528b 100644 (file)
@@ -102,7 +102,8 @@ unsigned ConstantMerge::getAlignment(GlobalVariable *GV) const {
 }
 
 bool ConstantMerge::runOnModule(Module &M) {
-  DL = getAnalysisIfAvailable<DataLayout>();
+  DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
+  DL = DLP ? &DLP->getDataLayout() : 0;
 
   // Find all the globals that are marked "used".  These cannot be merged.
   SmallPtrSet<const GlobalValue*, 8> UsedGlobals;