It is actually a static file that returns 32 for ELF32 and 64 for
ELF64, which has nothing to do with the actual bitness of the target
architecture address.
The if is using the information obtained from the target (triple) and
falls back to getBytesInAddress only if the target is not 16, 32, or
64 bit (the target interface is also strange as it doesn't allow any
other values).
The
getBytesInAddress
virutal member-function for ELF files is implemented incorrectly in LLVM,It is actually a static file that returns 32 for ELF32 and 64 for ELF64, which has nothing to do with the actual bitness of the target architecture address.
The if is using the information obtained from the target (triple) and falls back to
getBytesInAddress
only if the target is not 16, 32, or 64 bit (the target interface is also strange as it doesn't allow any other values).