[BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs
authorYonghong Song <yhs@fb.com>
Wed, 18 Dec 2019 00:24:23 +0000 (16:24 -0800)
committerYonghong Song <yhs@fb.com>
Fri, 10 Jan 2020 17:06:31 +0000 (09:06 -0800)
commitfbb64aa69835c8e3e9efe0afc8a73058b5a0fb3c
treeaa2016541f4e921329587cf73f760ee3eee3f995
parent26cdaeb1f05ba140011a43ef1ea8a37d3cf416d9
[BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs

Previously extern function is added as BTF_KIND_VAR. This does not work
well with existing BTF infrastructure as function expected to use
BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO.

This patch added extern function to BTF_KIND_FUNC. The two bits 0:1
of btf_type.info are used to indicate what kind of function it is:
  0: static
  1: global
  2: extern

Differential Revision: https://reviews.llvm.org/D71638
36 files changed:
llvm/lib/Target/BPF/BTF.h
llvm/lib/Target/BPF/BTFDebug.cpp
llvm/lib/Target/BPF/BTFDebug.h
llvm/test/CodeGen/BPF/BTF/binary-format.ll
llvm/test/CodeGen/BPF/BTF/extern-builtin.ll [new file with mode: 0644]
llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll [new file with mode: 0644]
llvm/test/CodeGen/BPF/BTF/extern-global-var.ll
llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll
llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll
llvm/test/CodeGen/BPF/BTF/extern-var-func.ll
llvm/test/CodeGen/BPF/BTF/extern-var-section.ll
llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll
llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll
llvm/test/CodeGen/BPF/BTF/filename.ll
llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll
llvm/test/CodeGen/BPF/BTF/func-non-void.ll
llvm/test/CodeGen/BPF/BTF/func-source.ll
llvm/test/CodeGen/BPF/BTF/func-typedef.ll
llvm/test/CodeGen/BPF/BTF/func-unused-arg.ll
llvm/test/CodeGen/BPF/BTF/func-void.ll
llvm/test/CodeGen/BPF/BTF/local-var.ll
llvm/test/CodeGen/BPF/BTF/static-func.ll [new file with mode: 0644]
llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll
llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll
llvm/test/CodeGen/BPF/BTF/static-var-inited.ll
llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll
llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll
llvm/test/CodeGen/BPF/BTF/static-var-sec.ll
llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll
llvm/test/CodeGen/BPF/BTF/static-var.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll