Fix handling of missing DataLayout in sanitizers.

Pass::doInitialization is supposed to return False when it did not
change the program, not when a fatal error occurs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evgeniy Stepanov 2014-04-23 12:51:32 +00:00
parent 8b9fe76c0c
commit da2d85cfc8
4 changed files with 4 additions and 4 deletions

View File

@ -1164,7 +1164,7 @@ bool AddressSanitizer::doInitialization(Module &M) {
// Initialize the private fields. No one has accessed them before.
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
if (!DLP)
return false;
report_fatal_error("data layout missing");
DL = &DLP->getDataLayout();
BL.reset(SpecialCaseList::createOrDie(BlacklistFile));

View File

@ -345,7 +345,7 @@ FunctionType *DataFlowSanitizer::getCustomFunctionType(FunctionType *T) {
bool DataFlowSanitizer::doInitialization(Module &M) {
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
if (!DLP)
return false;
report_fatal_error("data layout missing");
DL = &DLP->getDataLayout();
Mod = &M;

View File

@ -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));

View File

@ -226,7 +226,7 @@ void ThreadSanitizer::initializeCallbacks(Module &M) {
bool ThreadSanitizer::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));