[PATCH] D36208: [mips] Enable target-specific attributes for MIPS64

Simon Atanasyan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 23:57:10 PDT 2017


atanasyan added inline comments.


================
Comment at: lib/Sema/SemaDeclAttr.cpp:5979-5981
+    if (S.Context.getTargetInfo().getABI() != "o32")
+      S.Diag(Attr.getLoc(), diag::err_attribute_supported_by_o32)
+          << Attr.getName() << D->getLocation();
----------------
aaron.ballman wrote:
> Please do not put logic into the switch statement, but instead sink it into a helper function. We hope to remove the boilerplate switch someday, so keeping with the `handleFooAttr()` pattern is preferred. Same below.
> 
> Further, why is this not handled by a TargetSpecificAttr in Attr.td? See `TargetMicrosoftCXXABI` and `MSNoVTable` for an example.
> Further, why is this not handled by a TargetSpecificAttr in Attr.td? See TargetMicrosoftCXXABI and MSNoVTable for an example.

I thought about this, but in that case compiler will show "unknown attribute 'mips16' ignored" warning in case of using `mips16` on MIPS64 targets. As to me this warning is not quite correct in that case because `mips16`, `micromips`, `interrupt` all are known MIPS-specific attributes, but not applicable on MIPS64 by various reasons.


Repository:
  rL LLVM

https://reviews.llvm.org/D36208





More information about the cfe-commits mailing list