diff options
| author | Yonghong Song <yhs@fb.com> | 2019-03-15 17:39:10 +0000 |
|---|---|---|
| committer | Yonghong Song <yhs@fb.com> | 2019-03-15 17:39:10 +0000 |
| commit | 44ed286a2f80ba9b4d8a1b0ff84f44914915ea97 (patch) | |
| tree | de410bf898b5da069af4361a31b0f18356c8e49e /llvm/lib/Demangle/Demangle.cpp | |
| parent | 1cbbab9277af09f2da3f7eba7391452e8da8fe79 (diff) | |
| download | bcm5719-llvm-44ed286a2f80ba9b4d8a1b0ff84f44914915ea97.tar.gz bcm5719-llvm-44ed286a2f80ba9b4d8a1b0ff84f44914915ea97.zip | |
[BPF] handle external global properly
Previous commit 6bc58e6d3dbd ("[BPF] do not generate unused local/global types")
tried to exclude global variable from type generation. The condition is:
if (Global.hasExternalLinkage())
continue;
This is not right. It also excluded initialized globals.
The correct condition (from AssemblyWriter::printGlobal()) is:
if (!GV->hasInitializer() && GV->hasExternalLinkage())
Out << "external ";
Let us do the same in BTF type generation. Also added a test for it.
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356279
Diffstat (limited to 'llvm/lib/Demangle/Demangle.cpp')
0 files changed, 0 insertions, 0 deletions

