llvm-project/clang/lib
Yonghong Song 072cde03aa [Clang][BPF] implement __builtin_btf_type_id() builtin function
Such a builtin function is mostly useful to preserve btf type id
for non-global data. For example,
   extern void foo(..., void *data, int size);
   int test(...) {
     struct t { int a; int b; int c; } d;
     d.a = ...; d.b = ...; d.c = ...;
     foo(..., &d, sizeof(d));
   }

The function "foo" in the above only see raw data and does not
know what type of the data is. In certain cases, e.g., logging,
the additional type information will help pretty print.

This patch implemented a BPF specific builtin
  u32 btf_type_id = __builtin_btf_type_id(param, flag)
which will return a btf type id for the "param".
flag == 0 will indicate a BTF local relocation,
which means btf type_id only adjusted when bpf program BTF changes.
flag == 1 will indicate a BTF remote relocation,
which means btf type_id is adjusted against linux kernel or
future other entities.

Differential Revision: https://reviews.llvm.org/D74668
2020-05-15 09:44:54 -07:00
..
ARCMigrate [NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec. 2020-04-23 17:21:25 -04:00
AST [ObjC] Add compatibility mode for type checking of qualified id block parameters. 2020-05-14 12:08:19 -07:00
ASTMatchers [ASTMatchers] Fix isDerivedFrom for recursive templates 2020-04-15 12:49:01 -07:00
Analysis Reapply "Add support for #pragma float_control" with buildbot fixes 2020-05-04 05:51:25 -07:00
Basic [clang][Preprocessor] Replace the slow translateFile call by a new, faster isMainFile check 2020-05-14 14:13:34 -07:00
CodeGen [Clang][BPF] implement __builtin_btf_type_id() builtin function 2020-05-15 09:44:54 -07:00
CrossTU Revert "[analyzer] On-demand parsing capability for CTU" 2020-04-27 14:27:04 +02:00
DirectoryWatcher [DirectoryWatcher] Do not use FSEvents on non-macOS platforms 2020-04-23 10:22:28 -07:00
Driver [ARM][MachineOutliner] Add Machine Outliner support for ARM. 2020-05-15 08:44:23 +02:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set 2020-05-15 16:40:31 +02:00
Frontend [CSInfo][ISEL] Call site info generation support for Mips 2020-05-15 10:13:15 +02:00
FrontendTool [llvm][clang][IFS] Enhancing the llvm-ifs yaml format for symbol lists. 2020-04-01 10:49:06 -04:00
Headers [WebAssembly] Implement pseudo-min/max SIMD instructions 2020-05-12 09:39:01 -07:00
Index Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
Lex [clang][Preprocessor] Replace the slow translateFile call by a new, faster isMainFile check 2020-05-14 14:13:34 -07:00
Parse Enforce the C++11 anonymous enum bitfields check even for 2020-05-10 14:03:50 -07:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [Clang][BPF] implement __builtin_btf_type_id() builtin function 2020-05-15 09:44:54 -07:00
Serialization [Matrix] Add matrix type to Clang. 2020-05-11 18:55:45 +01:00
StaticAnalyzer [analyzer] Improve PlacementNewChecker 2020-05-14 15:50:39 +02:00
Tooling Strip -showIncludes in getClangStripDependencyFileAdjuster() 2020-04-27 11:20:08 -07:00
CMakeLists.txt Reland [clang] DirectoryWatcher 2019-07-12 20:34:10 +00:00