[SanitizerBinaryMetadata] Emit constants as ULEB128
authorMarco Elver <elver@google.com>
Wed, 8 Feb 2023 11:25:01 +0000 (12:25 +0100)
committerMarco Elver <elver@google.com>
Wed, 8 Feb 2023 12:12:34 +0000 (13:12 +0100)
commitbf9814b70560637e322056135fb9a8e3c650e828
tree1be447e0337ec94a896dfe3add6bf9c6b01e44cc
parent3d53b52730034b9ec78871b8dcde8287dd811016
[SanitizerBinaryMetadata] Emit constants as ULEB128

Emit all constant integers produced by SanitizerBinaryMetadata as
ULEB128 to further reduce binary space used. Increasing the version is
not necessary given this change depends on (and will land) along with
the bump to v2.

To support this, the !pcsections metadata format is extended to allow
for per-section options, encoded in the first MD operator which must
always be a string and contain the section: "<section>!<options>".

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D143484
clang/test/CodeGen/sanitize-metadata.c
compiler-rt/test/metadata/common.h
llvm/docs/PCSectionsMetadata.rst
llvm/include/llvm/CodeGen/AsmPrinter.h
llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp
llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp
llvm/test/CodeGen/X86/pcsections.ll
llvm/test/Instrumentation/SanitizerBinaryMetadata/atomics.ll