summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/Attr.td6
-rw-r--r--clang/lib/Sema/TargetAttributesSema.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index ff4050d462e..3f42c2e154e 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -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 {
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp
index 1469e1247f6..034e460eeb2 100644
--- a/clang/lib/Sema/TargetAttributesSema.cpp
+++ b/clang/lib/Sema/TargetAttributesSema.cpp
@@ -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;
OpenPOWER on IntegriCloud