Eli Bendersky
2012-Dec-18 19:12 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
Scenario: sometimes when creating tests for MC, I run llc, take its assembly (.s) output and copy-paste parts of it into a test. 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. I had an informal chat about this with Jim on the IRC channel and he tends to agree, but I just wanted to make sure it makes sense for the community before starting this. The change mostly involves lib/MC and the target-specific TableGen files defining instructions. Eli
Caldarale, Charles R
2012-Dec-18 19:36 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
> 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? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Jim Grosbach
2012-Dec-18 19:51 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
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." 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. -Jim> - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Eli Bendersky
2012-Dec-18 21:01 UTC
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
On Tue, 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? >Here's how some random output currently looks in a 2-space-per-tab editor: cmpl $0, -28(%rbp) je .LBB2_9 movsbl -81(%rbp), %eax movq -16(%rbp), %rcx movb 56(%rcx), %dl andb $1, %dl movzbl %dl, %esi So if you're worried about ugliness, it's already there :-) Eli
Reasonably Related Threads
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?
- [LLVMdev] Getting rid of tabs in LLVM's assembly output?