[lld] r292042 - Simplify string output. NFC.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 10:59:38 PST 2017


Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:
>  static void writeOutSecLine(raw_fd_ostream &OS, uint64_t Address, uint64_t Size,
>                              uint64_t Align, StringRef Name) {
> -  OS << format_hex_no_prefix(Address, 8) << ' '
> -     << format_hex_no_prefix(Size, 8) << ' ' << format("%5x ", Align)
> -     << left_justify(Name, 7);
> +  OS << format("%08x %08x %5x ", Address, Size, Align) << left_justify(Name, 7);

Thanks.

>  static void writeMapFile2(raw_fd_ostream &OS,
>                            ArrayRef<OutputSection *> OutputSections) {
> -  OS << left_justify("Address", 8) << ' ' << left_justify("Size", 8)
> -     << ' ' << left_justify("Align", 5) << ' ' << left_justify("Out", 7) << ' '
> -     << left_justify("In", 7) << ' ' << left_justify("File", 7) << " Symbol\n";
> +  OS << "Address  Size     Align Out     In      File    Symbol\n";

This part is now a bit more fragile. If we change the width of any of
the fields we now have remember to add spaces in here.

Cheers,
Rafael


More information about the llvm-commits mailing list