r196420 - The MSP430Interrupt attribute does have a sema handler (it's in TargetAttributesSema). Added a FIXME about the attribute being nameless when it really does have a valid name, and a comment explaining why we're using the name instead of the attribute kind.
Aaron Ballman
aaron at aaronballman.com
Wed Dec 4 14:23:43 PST 2013
Author: aaronballman
Date: Wed Dec 4 16:23:43 2013
New Revision: 196420
URL: http://llvm.org/viewvc/llvm-project?rev=196420&view=rev
Log:
The MSP430Interrupt attribute does have a sema handler (it's in TargetAttributesSema). Added a FIXME about the attribute being nameless when it really does have a valid name, and a comment explaining why we're using the name instead of the attribute kind.
Modified:
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/lib/Sema/TargetAttributesSema.cpp
Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=196420&r1=196419&r2=196420&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Wed Dec 4 16:23:43 2013
@@ -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 {
Modified: cfe/trunk/lib/Sema/TargetAttributesSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TargetAttributesSema.cpp?rev=196420&r1=196419&r2=196420&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TargetAttributesSema.cpp (original)
+++ cfe/trunk/lib/Sema/TargetAttributesSema.cpp Wed Dec 4 16:23:43 2013
@@ -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;
More information about the cfe-commits
mailing list