diff options
| author | Yonghong Song <yhs@fb.com> | 2019-02-02 05:54:59 +0000 |
|---|---|---|
| committer | Yonghong Song <yhs@fb.com> | 2019-02-02 05:54:59 +0000 |
| commit | fa3654008be8738853db0e8f212776fae930fff9 (patch) | |
| tree | bd297d64ded2fb9f8dfc84551721cd0cc8f0025d /llvm/lib | |
| parent | c9a69acc7e737782e5aefed44efd85e95397f856 (diff) | |
| download | bcm5719-llvm-fa3654008be8738853db0e8f212776fae930fff9.tar.gz bcm5719-llvm-fa3654008be8738853db0e8f212776fae930fff9.zip | |
[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>
llvm-svn: 352952
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/BPF/BTFDebug.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/BPF/BTFDebug.cpp b/llvm/lib/Target/BPF/BTFDebug.cpp index 8fc64d8c7d0..ca3a8c5740e 100644 --- a/llvm/lib/Target/BPF/BTFDebug.cpp +++ b/llvm/lib/Target/BPF/BTFDebug.cpp @@ -493,7 +493,7 @@ std::string BTFDebug::populateFileContent(const DISubprogram *SP) { auto File = SP->getFile(); std::string FileName; - if (File->getDirectory().size()) + if (!File->getFilename().startswith("/") && File->getDirectory().size()) FileName = File->getDirectory().str() + "/" + File->getFilename().str(); else FileName = File->getFilename(); |

