Fix handling of missing DataLayout in sanitizers.
[oota-llvm.git] / lib / Transforms / Instrumentation / MemorySanitizer.cpp
index 0ac33840487088b8fd40c5e7c6a0bfa33ca5802e..f3a8bf7a3ad06c110de330bcc1fc11c6d10672f9 100644 (file)
@@ -93,8 +93,6 @@
 
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "msan"
-
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/SmallString.h"
 
 using namespace llvm;
 
+#define DEBUG_TYPE "msan"
+
 static const uint64_t kShadowMask32 = 1ULL << 31;
 static const uint64_t kShadowMask64 = 1ULL << 46;
 static const uint64_t kOriginOffset32 = 1ULL << 30;
@@ -188,7 +188,7 @@ static cl::opt<int> ClInstrumentationWithCallThreshold(
         "If the function being instrumented requires more than "
         "this number of checks and origin stores, use callbacks instead of "
         "inline checks (-1 means never use callbacks)."),
-    cl::Hidden, cl::init(-1));
+    cl::Hidden, cl::init(3500));
 
 // Experimental. Wraps all indirect calls in the instrumented code with
 // a call to the given function. This is needed to assist the dynamic
@@ -427,7 +427,7 @@ void MemorySanitizer::initializeCallbacks(Module &M) {
 bool MemorySanitizer::doInitialization(Module &M) {
   DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
   if (!DLP)
-    return false;
+    report_fatal_error("data layout missing");
   DL = &DLP->getDataLayout();
 
   BL.reset(SpecialCaseList::createOrDie(BlacklistFile));