[PATCH] D10802: [mips] Interrupt attribute support.

Daniel Sanders via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 05:17:16 PDT 2015


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

LGTM with a few nits


================
Comment at: include/clang/Basic/Attr.td:841-842
@@ +840,4 @@
+def MipsInterrupt : InheritableAttr, TargetSpecificAttr<TargetMips> {
+  // NOTE: if you add any additional spellings, ARMInterrupts's &
+  // MSP430Interrupt must match.
+  let Spellings = [GNU<"interrupt">];
----------------
if -> If
ARMInterrupts's -> ARMInterrupt's

Also, you should update the comments for ARMInterrupt and MSP430Interrupt to mention MipsInterrupt.

================
Comment at: include/clang/Basic/AttrDocs.td:690-691
@@ +689,4 @@
+The parameter passed to the interrupt attribute is optional, but if
+provided it must be a string literal with one of the following values: "sw0",
+"sw1", "hw0", "hw1", "hw2", "hw3", "hw4", "hw5" or "eic".
+
----------------
Aside from "eic" shouldn't these be "vector=..."?

================
Comment at: lib/Sema/SemaDeclAttr.cpp:4222
@@ -4192,3 +4221,3 @@
     handleMSP430InterruptAttr(S, D, Attr);
-  else
+  else if (S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::arm)
     handleARMInterruptAttr(S, D, Attr);
----------------
I think you also need to cover aarch64, thumb, etc. It's probably best to leave it as an else clause and add mips above it.


http://reviews.llvm.org/D10802





More information about the cfe-commits mailing list