[LLVMdev] Getting rid of tabs in LLVM's assembly output?

Chris Lattner clattner at apple.com
Tue Dec 18 12:06:58 PST 2012


On Dec 18, 2012, at 11:51 AM, Jim Grosbach <grosbach at apple.com> wrote:
> On Dec 18, 2012, at 11:36 AM, "Caldarale, Charles R" <Chuck.Caldarale at unisys.com> wrote:
> 
>>> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
>>> On Behalf Of Eli Bendersky
>>> Subject: [LLVMdev] Getting rid of tabs in LLVM's assembly output?
>> 
>>> Problem: I then get tabs in my tests, which are discouraged by LLVM's
>>> own code standards, because assembly output uses tabs extensively.
>> 
>>> Proposal: get rid of tabs by just replacing them with two spaces everywhere.
>> 
>> That will cause some really ugly output; can a somewhat more intelligent formatter be used to keep columns aligned?
>> 
> 
> I don't mind getting rid of tabs as a general thing, but it is a rather large undertaking. I concur with Chuck that we'd want to replace them with some intelligent column-aware formatting rather than a straight "two spaces per tab."

include/llvm/Support/FormattedStream.h supports PadToColumn, which is perfect for this.

> FWIW, partly for this exact reason, there's effectively a local exception that tabs are OK in .s file assembler test cases. If that's the main motivation, I wouldn't worry about it.

I agree, tabs in testcases are fine IMO.

-Chris



More information about the llvm-dev mailing list