llvm.org GIT mirror llvm / 3d019e2
Merging r340839: ------------------------------------------------------------------------ r340839 | bcain | 2018-08-28 18:23:39 +0200 (Tue, 28 Aug 2018) | 14 lines [debuginfo] generate debug info with asm+.file Summary: For assembly input files, generate debug info even when the .file directive is present, provided it does not include a file-number argument. Fixes PR38695. Reviewers: probinson, sidneym Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D51315 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_70@341036 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 2 years ago
2 changed file(s) with 32 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
33473347 }
33483348 }
33493349
3350 // In case there is a -g option as well as debug info from directive .file,
3351 // we turn off the -g option, directly use the existing debug info instead.
3352 // Also reset any implicit ".file 0" for the assembler source.
3353 if (Ctx.getGenDwarfForAssembly()) {
3354 Ctx.getMCDwarfLineTable(0).resetRootFile();
3355 Ctx.setGenDwarfForAssembly(false);
3356 }
3357
33583350 if (FileNumber == -1)
33593351 getStreamer().EmitFileDirective(Filename);
33603352 else {
3353 // In case there is a -g option as well as debug info from directive .file,
3354 // we turn off the -g option, directly use the existing debug info instead.
3355 // Also reset any implicit ".file 0" for the assembler source.
3356 if (Ctx.getGenDwarfForAssembly()) {
3357 Ctx.getMCDwarfLineTable(0).resetRootFile();
3358 Ctx.setGenDwarfForAssembly(false);
3359 }
3360
33613361 MD5::MD5Result *CKMem = nullptr;
33623362 if (HasMD5) {
33633363 CKMem = (MD5::MD5Result *)Ctx.allocate(sizeof(MD5::MD5Result), 1);
0 // RUN: llvm-mc -g -triple i386-unknown-unknown %s | FileCheck -check-prefix=CHECK-DEFAULT %s
1 // RUN: llvm-mc -g -triple i386-unknown-unknown %s -filetype=obj | obj2yaml | FileCheck -check-prefix=CHECK-DEBUG %s
2
3 // Test for Bug 38695
4 // This testcase has a single function and a .file directive
5 // without the [file-num] argument. When compiled with -g,
6 // this testcase will not report error, and generate new
7 // debug info.
8
9 .file "hello"
10 .text
11
12 f1:
13 nop
14 .size f1, .-f1
15
16 // CHECK-DEFAULT: .file "hello"
17
18 // CHECK-DEBUG: Sections:
19 // CHECK-DEBUG: - Name: .text
20 // CHECK-DEBUG: - Name: .debug_info
21 // CHECK-DEBUG: - Name: .rel.debug_info
22 // CHECK-DEBUG: Info: .debug_info
23 // CHECK-DEBUG: Symbols: