Band-aid fix for PR22032: don't emit DWARF debug info if AddressSanitizer is enabled on Windows

llvm-svn: 224860
This commit is contained in:
Timur Iskhodzhanov 2014-12-26 17:00:51 +00:00
parent 5d94634c13
commit b6fa52f274
2 changed files with 19 additions and 3 deletions

View File

@ -222,13 +222,26 @@ bool AsmPrinter::doInitialization(Module &M) {
}
if (MAI->doesSupportDebugInformation()) {
if (Triple(TM.getTargetTriple()).isKnownWindowsMSVCEnvironment())
bool skip_dwarf = false;
if (Triple(TM.getTargetTriple()).isKnownWindowsMSVCEnvironment()) {
Handlers.push_back(HandlerInfo(new WinCodeViewLineTables(this),
DbgTimerName,
CodeViewLineTablesGroupName));
// FIXME: Don't emit DWARF debug info if there's at least one function
// with AddressSanitizer instrumentation.
// This is a band-aid fix for PR22032.
for (auto &F : M.functions()) {
if (F.hasFnAttribute(Attribute::SanitizeAddress)) {
skip_dwarf = true;
break;
}
}
}
if (!skip_dwarf) {
DD = new DwarfDebug(this, &M);
Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
}
}
EHStreamer *ES = nullptr;
switch (MAI->getExceptionHandlingType()) {

View File

@ -13,6 +13,9 @@
; X86-NEXT: calll ___asan_init_v3
; X86-NEXT: retl
; Make sure we don't put any DWARF debug info for ASan-instrumented modules.
; X86-NOT: DWARF
; ModuleID = 'asan.c'
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
target triple = "i686-pc-win32"