[llvm-commits] Mips Assembler stubs for llvm

Medic, Vladimir vmedic at mips.com
Fri Aug 10 03:22:37 PDT 2012


Hi Rafael,
thank you for the comments. The emitMatchRegisterName will fail with assertion, so __attribute__((unused)) will not do the job I believe. I have adder a flag ShouldEmitMatchRegisterName in AsmParser class definition in Target.td. This flag defaults to 1 and in Mips.td I have set it to 0 so it doesn't change the behavior or definitions of other targets. This flag is checked prior to call to emitMatchRegisterName. The patch is attached to this email.
Looking forward to your comments.

Vladimir

________________________________________
From: Rafael EspĂ­ndola [rafael.espindola at gmail.com]
Sent: Wednesday, August 08, 2012 4:02 PM
To: Medic, Vladimir
Cc: Jim Grosbach; llvm-commits at cs.uiuc.edu; Jovanovic, Petar
Subject: Re: [llvm-commits] Mips Assembler stubs for llvm

On 23 July 2012 08:50, Medic, Vladimir <vmedic at mips.com> wrote:
> Hi all,
> please find attached the updated version of the patch for Mips assembler
> stub version. It clears a trailing white space error from the previous
> patch.
> Looking forward to your comments on it.


Looks like you are still missing some unimplemented errors:

+ virtual void print(raw_ostream &OS) const {}

+  // This should be omitted for Mips target
+  if (Target.getName().find("Mips") == std::string::npos)
   emitMatchRegisterName(Target, AsmParser, OS);

So, will the call to emitMatchRegisterName fail or just produce a
bogus implementation? If it just produces a bogus one, making tablegen
print it with __attribute__((unused)) is fine. You can add the
attribute for all targets, as it just avoids a warning if the function
is unused.

If tablegen fails to produce the matcher, please add a flag to the .td
files (ShouldEmitRegisterMatcher?) and use that instead of checking
for "Mips" in the target string.

> Vladimir
> ________________________________

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MipsAsmParserStubs.patch
Type: application/octet-stream
Size: 9372 bytes
Desc: MipsAsmParserStubs.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120810/7ab65955/attachment.obj>


More information about the llvm-commits mailing list