[PATCH] Implement getNoopForMachoTarget for SPARC

Brad Smith brad at comstyle.com
Thu Sep 4 11:43:04 PDT 2014


On 03/09/14 9:59 PM, Eric Christopher wrote:
>
>
>
> On Wed, Sep 3, 2014 at 6:09 PM, Brad Smith <brad at comstyle.com
> <mailto:brad at comstyle.com>> wrote:
>
>     On 02/09/14 3:18 AM, Joerg Sonnenberger wrote:
>
>         On Mon, Sep 01, 2014 at 10:07:46PM -0700, Owen Anderson wrote:
>
>             Why are you using MachO on a SPARC target?
>
>
>         See mail from me a bit ago -- because MC uses that function to
>         ensure
>         that an empty function gets at least one instruction.
>
>
>     Which was to try to deal with the issue of the assembler crashing..
>
>     EmitRawText called on an MCStreamer that doesn't support it,
>     something must not be fully mc'ized
>
>     from lib/CodeGen/AsmPrinter/__AsmPrinter.cpp..
>
>        // If the function is empty and the object file uses
>     .subsections_via_symbols,
>        // then we need to emit *something* to the function body to
>     prevent the
>        // labels from collapsing together.  Just emit a noop.
>        if ((MAI->__hasSubsectionsViaSymbols() && !HasAnyRealCode) ||
>     RequiresNoop) {
>          MCInst Noop;
>
>     TM.getSubtargetImpl()->__getInstrInfo()->__getNoopForMachoTarget(Noop);
>          if (Noop.getOpcode()) {
>            OutStreamer.AddComment("avoids zero-length function");
>            OutStreamer.EmitInstruction(__Noop, getSubtargetInfo());
>          } else  // Target not mc-ized yet.
>            OutStreamer.EmitRawText(__StringRef("\tnop\n"));
>
>        }
>
>
> ... that's terrible.
>
> Also it probably shouldn't be returning subsections via symbols as well.
>
> Anyhow, let's solve the original problem better :)

Soo... any ideas here?


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the llvm-commits mailing list