llvm.org GIT mirror llvm / 43ed711
[codeview] Fix assertion failure introduced in r295354 refactoring CodeViewDebug sets Asm to nullptr to disable debug info generation. You can get a .ll file like no-cus.ll from 'clang -gcodeview -g0', which happens in the ubsan test suite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302923 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 3 years ago
2 changed file(s) with 26 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
128128 }
129129
130130 void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
131 assert(Asm);
132131 PrevInstBB = nullptr;
133132
134 if (!hasDebugInfo(MMI, MF)) {
133 if (!Asm || !hasDebugInfo(MMI, MF)) {
135134 skippedNonDebugFunction();
136135 return;
137136 }
0 ; RUN: llc < %s -filetype=obj -o %t.o
1 ; RUN: llvm-objdump -section-headers %t.o | FileCheck %s
2
3 ; Don't emit debug info in this scenario and don't crash.
4
5 ; CHECK-NOT: .debug$S
6 ; CHECK: .text
7 ; CHECK-NOT: .debug$S
8
9 ; ModuleID = 't.cpp'
10 source_filename = "t.cpp"
11 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
12 target triple = "x86_64-pc-windows-msvc19.10.24728"
13
14 define void @f() {
15 entry:
16 ret void
17 }
18
19 !llvm.module.flags = !{!0, !1}
20 !llvm.ident = !{!2}
21
22 !0 = !{i32 2, !"CodeView", i32 1}
23 !1 = !{i32 1, !"PIC Level", i32 2}
24 !2 = !{!"clang version 5.0.0 "}