aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@gmail.com>2020-09-24 10:54:28 -0400
committerNathan Froyd <froydnj@gmail.com>2020-09-24 10:54:28 -0400
commit31a3c5fb45b78bdaa78d94ffcc9258e839002016 (patch)
tree1b7503c38aa86a25e5fbe818aa5670a1ab492307 /clang/lib/Frontend/CompilerInvocation.cpp
parent283036394ee606401ebb6601bb97b500e11a2830 (diff)
downloadllvm-31a3c5fb45b78bdaa78d94ffcc9258e839002016.zip
llvm-31a3c5fb45b78bdaa78d94ffcc9258e839002016.tar.gz
llvm-31a3c5fb45b78bdaa78d94ffcc9258e839002016.tar.bz2
[clang] use string tables for static diagnostic descriptions
Using a pointer for the description string in StaticDiagInfoRec causes several problems: 1. We don't need to use a whole pointer to represent the string; 2. The use of pointers incurs runtime relocations for those pointers; the relocations take up space on disk and represent runtime overhead; 3. The need to relocate data implies that, on some platforms, the entire array containing StaticDiagInfoRecs cannot be shared between processes. This patch changes the storage scheme for the diagnostic descriptions to avoid these problems. We instead generate (effectively) one large string and then StaticDiagInfoRec conceptually holds offsets into the string. We elected to also move the storage of those offsets into a separate array to further reduce the space required. On x86-64 Linux, this change removes about 120KB of relocations and moves about 60KB from the non-shareable .data.rel.ro section to shareable .rodata. (The array is about 80KB before this, but we eliminated 4 bytes/entry by using offsets rather than pointers.) We actually reap this benefit twice, because these tables show up in both libclang.so and libclang-cpp.so and we get the reduction in both places. Differential Revision: https://reviews.llvm.org/D81865
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions