[HIP] Fix -gsplit-dwarf option
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Mon, 14 Sep 2020 18:21:30 +0000 (14:21 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Sat, 19 Sep 2020 14:06:51 +0000 (10:06 -0400)
commite50465ecefc964e5700df26fc7e02a673eed085a
tree42010cc49e76fab76832c65856ae790f065bf24c
parent04cebd900fde2c10d31a149895ed2495ff0994f7
[HIP] Fix -gsplit-dwarf option

when -gsplit option is used with clang driver, clang driver will create
a filename with .dwo option based on the input file name and pass
it to clang -cc1. This file is used for storing the debug info. Since
HIP generate separate object files for different GPU arch's,
this file should be different for different GPU arch. This patch
adds _ and GPU arch to the stem of the dwo file.

Differential Revision: https://reviews.llvm.org/D87791
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/CommonArgs.h
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/MinGW.cpp
clang/test/Driver/hip-gsplit-dwarf-options.hip [new file with mode: 0644]