[PATCH] D36464: Implemented sane default for llvm-objdump's relocation Value format
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 10:35:03 PDT 2017
Fedor Sergeev via Phabricator <reviews at reviews.llvm.org> writes:
> + StringRef suffix;
> switch (EF.getHeader()->e_machine) {
> + default:
> + // Default scheme is to print Target, as well as "+ <addend>" for nonzero
> + // addend. Should be acceptable for all normal purposes.
> + if (addend.hasValue() && addend.getValue() == 0)
> + addend = None;
> + break;
Given this you don't need Optional for addend, just initialize it to 0
and use != 0 instead of .hasValue.
Cheers,
Rafael
More information about the llvm-commits
mailing list