Useful with other infrastructure that consume LLVM statistics to get an
idea of distribution of section sizes.
The breakdown of various section types is subject to change, this is
just an initial go at gather some sort of stats.
Example stats compiling X86ISelLowering.cpp (-g1):
```
"elf-object-writer.AllocROBytes": 308268,
"elf-object-writer.AllocRWBytes": 6240,
"elf-object-writer.AllocTextBytes": 1659203,
"elf-object-writer.DebugBytes": 3180386,
"elf-object-writer.OtherBytes": 5862,
"elf-object-writer.RelocationBytes": 2623440,
"elf-object-writer.StrtabBytes": 228599,
"elf-object-writer.SymtabBytes": 120336,
"elf-object-writer.UnwindBytes": 85216,
```
14 lines
338 B
LLVM
14 lines
338 B
LLVM
; REQUIRES: asserts
|
|
; RUN: llc -o /dev/null -filetype=obj -stats %s 2>&1 | FileCheck %s
|
|
|
|
; CHECK-DAG: 1 elf-object-writer - Total size of SHF_ALLOC text sections
|
|
; CHECK-DAG: 1 elf-object-writer - Total size of SHF_ALLOC read-write sections
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
@g = global i8 1
|
|
|
|
define void @f() {
|
|
ret void
|
|
}
|