]> granicus.if.org Git - clang/commitdiff
The MSP430Interrupt attribute does have a sema handler (it's in TargetAttributesSema...
authorAaron Ballman <aaron@aaronballman.com>
Wed, 4 Dec 2013 22:23:43 +0000 (22:23 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 4 Dec 2013 22:23:43 +0000 (22:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196420 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Attr.td
lib/Sema/TargetAttributesSema.cpp

index ff4050d462ebae3f66d2e7080c745a62484fd62a..3f42c2e154e9b1956f5adb9c0b4767830d1197b6 100644 (file)
@@ -515,9 +515,13 @@ def MSABI : InheritableAttr {
 }
 
 def MSP430Interrupt : InheritableAttr, TargetSpecificAttr {
+  // FIXME: this attribute is spelled the same as the ARMInterrupt attribute,
+  // but two attributes cannot currently share the same name because of the
+  // getAttrKind function. However, in this case, the attributes are for
+  // different targets, so sharing the same name but different arguments is a
+  // reasonable design. For now, this attribute will remain having no spelling.
   let Spellings = [];
   let Args = [UnsignedArgument<"Number">];
-  let SemaHandler = 0;
 }
 
 def Mips16 : InheritableAttr, TargetSpecificAttr {
index 1469e1247f60b4780ec390ce2e8e9f5f0b4cd3e0..034e460eeb27dc334299876760bbb63288d36b4b 100644 (file)
@@ -108,6 +108,8 @@ namespace {
     MSP430AttributesSema() { }
     bool ProcessDeclAttribute(Scope *scope, Decl *D,
                               const AttributeList &Attr, Sema &S) const {
+      // Because this attribute has no spelling (see the FIXME in Attr.td as to
+      // why), we must check for the name instead of the attribute kind.
       if (Attr.getName()->getName() == "interrupt") {
         HandleMSP430InterruptAttr(D, Attr, S);
         return true;