llvm.org GIT mirror llvm / f4076dc
Band-aid fix for PR22032: don't emit DWARF debug info if AddressSanitizer is enabled on Windows git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224860 91177308-0d34-0410-b5e6-96231b3b80d8 Timur Iskhodzhanov 4 years ago
2 changed file(s) with 19 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
221221 }
222222
223223 if (MAI->doesSupportDebugInformation()) {
224 if (Triple(TM.getTargetTriple()).isKnownWindowsMSVCEnvironment())
224 bool skip_dwarf = false;
225 if (Triple(TM.getTargetTriple()).isKnownWindowsMSVCEnvironment()) {
225226 Handlers.push_back(HandlerInfo(new WinCodeViewLineTables(this),
226227 DbgTimerName,
227228 CodeViewLineTablesGroupName));
228 DD = new DwarfDebug(this, &M);
229 Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
229 // FIXME: Don't emit DWARF debug info if there's at least one function
230 // with AddressSanitizer instrumentation.
231 // This is a band-aid fix for PR22032.
232 for (auto &F : M.functions()) {
233 if (F.hasFnAttribute(Attribute::SanitizeAddress)) {
234 skip_dwarf = true;
235 break;
236 }
237 }
238 }
239 if (!skip_dwarf) {
240 DD = new DwarfDebug(this, &M);
241 Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
242 }
230243 }
231244
232245 EHStreamer *ES = nullptr;
1111 ; X86-NEXT: # BB
1212 ; X86-NEXT: calll ___asan_init_v3
1313 ; X86-NEXT: retl
14
15 ; Make sure we don't put any DWARF debug info for ASan-instrumented modules.
16 ; X86-NOT: DWARF
1417
1518 ; ModuleID = 'asan.c'
1619 target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"