llvm-project/llvm
Yonghong Song 6d67506964 [clang][BPF] support type exist/size and enum exist/value relocations
This patch added the following additional compile-once
run-everywhere (CO-RE) relocations:
  - existence/size of typedef, struct/union or enum type
  - enum value and enum value existence

These additional relocations will make CO-RE bpf programs more
adaptive for potential kernel internal data structure changes.

For existence/size relocations, the following two code patterns
are supported:
  1. uint32_t __builtin_preserve_type_info(*(<type> *)0, flag);
  2. <type> var;
     uint32_t __builtin_preserve_field_info(var, flag);
flag = 0 for existence relocation and flag = 1 for size relocation.

For enum value existence and enum value relocations, the following code
pattern is supported:
  uint64_t __builtin_preserve_enum_value(*(<enum_type> *)<enum_value>,
                                         flag);
flag = 0 means existence relocation and flag = 1 for enum value.
relocation. In the above <enum_type> can be an enum type or
a typedef to enum type. The <enum_value> needs to be an enumerator
value from the same enum type. The return type is uint64_t to
permit potential 64bit enumerator values.

Differential Revision: https://reviews.llvm.org/D83242
2020-08-04 08:39:53 -07:00
..
benchmarks
bindings [Bindings] Remove ipc_propagation. 2020-08-02 22:36:53 +01:00
cmake Partially revert "[cmake] Make MSVC generate appropriate __cplusplus macro definition" 2020-08-04 12:22:11 +03:00
docs Fix sphinx "Title underline too short" warning 2020-08-04 16:36:00 +01:00
examples [llvm][examples][SimplifyCFG] Fix pass's IR changed reporting 2020-07-27 13:39:58 -06:00
include [clang][BPF] support type exist/size and enum exist/value relocations 2020-08-04 08:39:53 -07:00
lib [PowerPC] Don't remove single swap between the load and store 2020-08-04 10:38:15 -05:00
projects
resources
runtimes [CMake] Bump CMake minimum version to 3.13.4 2020-07-22 14:25:07 -04:00
test [PowerPC] Don't remove single swap between the load and store 2020-08-04 10:38:15 -05:00
tools [llvm-readobj] - A third attempt to fix BB. 2020-08-04 12:44:26 +03:00
unittests [DebugInfo][unittest] Use YAML to generate the .debug_loclists section. 2020-08-04 16:37:51 +08:00
utils [lit] Add --time-trace-output to lit 2020-08-04 14:25:23 +01:00
.clang-format
.clang-tidy
.gitattributes
.gitignore [clangd] Store index in '.cache/clangd/index' instead of '.clangd/index' 2020-07-07 14:53:45 +02:00
CMakeLists.txt [CMake] Bump CMake minimum version to 3.13.4 2020-07-22 14:25:07 -04:00
CODE_OWNERS.TXT
CREDITS.TXT [test commit] Add my name to the CREDITS.TXT 2020-07-24 12:05:53 -05:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.