]> granicus.if.org Git - llvm/commit
[BPF] [BTF] Process FileName with absolute path correctly
authorYonghong Song <yhs@fb.com>
Sat, 2 Feb 2019 05:54:59 +0000 (05:54 +0000)
committerYonghong Song <yhs@fb.com>
Sat, 2 Feb 2019 05:54:59 +0000 (05:54 +0000)
commit2e3ef196ba3b492c672f71535965c34bf6ce61ce
tree411118be36e2406b001e9438bfdebb25567d8ad9
parentd9a8f328e91136772a0189a22b05402f337ca296
[BPF] [BTF] Process FileName with absolute path correctly

In IR, sometimes the following attributes for DIFile may be
generated:
  filename: /home/yhs/test.c
  directory: /tmp
The /tmp may represent the working directory of the compilation
process.

In such cases, since filename is with absolute path,
the directory should be ignored by BTF. The filename alone is
enough to get the source.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352952 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/BPF/BTFDebug.cpp
test/CodeGen/BPF/BTF/filename.ll [new file with mode: 0644]