Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / Transforms / Instrumentation / ThreadSanitizer.cpp
index e4a49112144e49c04ccd48d09e17d571d44d2b2e..6b50ce9513b694785cfd4b2ac412b1b24170076f 100644 (file)
@@ -230,10 +230,7 @@ void ThreadSanitizer::initializeCallbacks(Module &M) {
 }
 
 bool ThreadSanitizer::doInitialization(Module &M) {
-  DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
-  if (!DLP)
-    report_fatal_error("data layout missing");
-  DL = &DLP->getDataLayout();
+  DL = &M.getDataLayout();
 
   // Always insert a call to __tsan_init into the module's CTORs.
   IRBuilder<> IRB(M.getContext());