llvm-project/clang/lib/Driver
Fangrui Song 51fc742ce7 [Driver] Let -fno-integrated-as -gdwarf-5 use -fdwarf-directory-asm
While GNU as only allows the directory form of the .file directive for DWARF v5,
the integrated assembler prefers the directory form on all DWARF versions
(-fdwarf-directory-asm).

We currently set CC1 -fno-dwarf-directory-asm for -fno-integrated-as -gdwarf-5
which may cause the directory entry 0 and the filename entry 0 to be incorrect
(see D105662 and the example below). This patch makes -fno-integrated-as -gdwarf-5 use
-fdwarf-directory-asm as well.

```
cd /tmp/c

before
% clang -g -gdwarf-5 -fno-integrated-as e/a.c -S -o - | grep '\.file.*0'
        .file   0 "/tmp/c/e/a.c" md5 0x97e31cee64b4e58a4af8787512d735b6
% clang -g -gdwarf-5 -fno-integrated-as e/a.c -c
% llvm-dwarfdump a.o | grep include_directories
include_directories[  0] = "/tmp/c/e"

after
% clang -g -gdwarf-5 -fno-integrated-as e/a.c -S -o - | grep '\.file.*0'
        .file   0 "/tmp/c" "e/a.c" md5 0x97e31cee64b4e58a4af8787512d735b6
% clang -g -gdwarf-5 -fno-integrated-as e/a.c -c
% llvm-dwarfdump a.o | grep include_directories
include_directories[  0] = "/tmp/c"
```

Reviewed By: #debug-info, dblaikie, osandov

Differential Revision: https://reviews.llvm.org/D105835
2021-07-12 15:46:20 -07:00
..
ToolChains [Driver] Let -fno-integrated-as -gdwarf-5 use -fdwarf-directory-asm 2021-07-12 15:46:20 -07:00
Action.cpp [CUDA][HIP] Add -fuse-cuid 2021-02-08 22:26:12 -05:00
CMakeLists.txt [cfe][driver][M68k](8/8) Clang driver support 2021-03-08 12:30:57 -08:00
Compilation.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
DarwinSDKInfo.cpp
Distro.cpp Add support of the next Ubuntu (Ubuntu 21.10 - Impish Idri) 2021-04-22 20:38:28 +02:00
Driver.cpp [OptTable] Rename PrintHelp to printHelp 2021-06-24 14:47:03 -07:00
DriverOptions.cpp [Driver] Use shared singleton instance of DriverOptTable 2019-09-04 14:26:28 +00:00
InputInfo.h
Job.cpp [clang-cl] Remove the /fallback option 2021-02-04 10:33:16 +01:00
Multilib.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
OptionUtils.cpp [NFC] Move OptionUtils from Basic to Driver 2019-12-23 08:11:23 -05:00
Phases.cpp [clang][ifs] Clang Interface Stubs ToolChain plumbing. 2019-10-08 15:23:14 +00:00
SanitizerArgs.cpp [clang-cl][sanitizer] Add -fsanitize-address-use-after-return to clang. 2021-06-11 12:07:35 -07:00
Tool.cpp Clang Driver: refactor support for writing response files to be 2020-06-29 18:27:02 -04:00
ToolChain.cpp [AIX] Add -lc++abi and -lunwind for linking 2021-05-27 15:48:53 +00:00
Types.cpp [OpenCL] Added distinct file extension for C++ for OpenCL. 2021-03-24 13:07:04 +00:00
XRayArgs.cpp [xray] Function coverage groups 2020-09-24 22:09:53 -04:00