[LLVMdev] LLC always has a tab?

ryan baird ryanrbaird at gmail.com
Sat Sep 8 14:49:50 PDT 2012


If anyone is looking for a solution to this that doesn't involve changing
TableGen, here's what I did for now:

I overrode the rule to make this file with My own, which is basically a
copy of theirs.  I changed it to be more specific so that it would always
override, and then I added two lines to remove it from the include file
before the make process continues.

$(ObjDir)/VPOGenAsmWriter.inc.tmp : VPO.td $(ObjDir)/.dir $(LLVM_TBLGEN)
        $(Echo) "Building $(<F) assembly writer with tblgen"
        $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
        grep -v 'O << "\\t"' $(call SYSPATH, $@) >$(call SYSPATH, $@).temp
        cp $(call SYSPATH, $@).temp $(call SYSPATH, $@)

To test it, make sure you change a related .td file so that the rule is
executed.

On Sat, Sep 8, 2012 at 3:10 PM, Martinez, Javier E <
javier.e.martinez at intel.com> wrote:

>  Ryan,****
>
> ** **
>
> I’ve always been bothered by this tab character that doesn’t come from the
> target. The line you’re looking for I believe is from
> /utils/TableGen/AsmWriterEmitter.cpp at line 428. In my opinion the target
> should control whether a prefix is printed before an instruction.****
>
> ** **
>
> Thanks,****
>
> Javier****
>
> ** **
>
> *From:* llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] *On
> Behalf Of *ryan baird
> *Sent:* Saturday, September 08, 2012 1:45 PM
> *To:* llvmdev at cs.uiuc.edu
> *Subject:* Re: [LLVMdev] LLC always has a tab?****
>
> ** **
>
> I forgot to mention, the generated file that has the tab is
> VPOGenAsmWriter.inc.****
>
> On Sat, Sep 8, 2012 at 2:43 PM, ryan baird <ryanrbaird at gmail.com> wrote:**
> **
>
> I'm building a target for the intermediate language of another compiler.
> The other intermediate language is close to an assembly language (RTL, 1
> operation per line), so I based my target off of the Mips target.  However,
> the intermediate language i'm targetting does not support tabs before the
> instructions.  I've looked through the files and found that the tab comes
> from the printInstruction() method, which is generated when compiling.
>
> Directly after all of the tables it generates, it produces this line:
> O << "\t";
>
> (O is the output stream)
>
> Since its in the generated code, I've been looking through the .td files,
> but haven't had any luck. How can I prevent this tab from being generated?
> ****
>
> ** **
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120908/cc47e19c/attachment.html>


More information about the llvm-dev mailing list