Use debug-prefix-map for AT_NAME
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 11 Jul 2018 12:30:35 +0000 (12:30 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 11 Jul 2018 12:30:35 +0000 (12:30 +0000)
commit26ddf274d79e33d4440e1983aa2ceffd3addbc84
tree2f60afef9323e93cf567c612e78bbe9e3a2c9e96
parent7e64c1ee9123071d64cd019e3344ca7781fd8b3b
Use debug-prefix-map for AT_NAME

AT_NAME was being emitted before the directory paths were remapped. This
ensures that all paths are remapped before anything is emitted.

An additional test case has been added.

Note that this only works if the replacement string is an absolute path.
If not, then AT_decl_file believes the new path is a relative path, and
joins that path with the compilation directory. I do not know of a good
way to resolve this.

Patch by: Siddhartha Bagaria (starsid)

Differential revision: https://reviews.llvm.org/D49169

llvm-svn: 336793
llvm/include/llvm/MC/MCContext.h
llvm/include/llvm/MC/MCDwarf.h
llvm/lib/MC/MCContext.cpp
llvm/lib/MC/MCDwarf.cpp
llvm/lib/MC/MCObjectStreamer.cpp
llvm/test/MC/ELF/debug-prefix-map.s