aaron.ballman added inline comments.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:259
@@ +258,3 @@
+def err_anyx86_interrupt_attribute : Error<
+  "interrupt service routine %select{must have 'void' return value|"
+  "can only have a pointer argument and an optional integer argument|"
----------------
rjmccall wrote:
> aaron.ballman wrote:
> > I still dislike "interrupt service routine" -- there is no interrupt 
> > service routine involved here because the attribute does not apply to that 
> > function to make it one. The issue is with the attribute's requirements on 
> > the function type, so I still prefer "x86 |x86-64'interrupt' attribute only 
> > applies to functions that...". Also, "have 'void' return value" is still 
> > incorrect -- they need to have a void return type. Something like:
> > 
> > "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that 
> > have %select{a 'void' return type|only a pointer parameter optionally 
> > followed by an integer parameter|a pointer as the first parameter|a %2 type 
> > as the second parameter}1"
> > 
> > (I also changed argument to parameter because arguments are on the caller 
> > side, and parameters are on the function declaration side.)
> It's fine to call it an interrupt service routine because the user intent to 
> declare it as one is obvious.  It's still an ISR, it's just an ill-formed 
> ISR.  It would even make some amount of sense to actually apply the attribute 
> in the AST and just mark the declaration ill-formed.
That would make this diagnostic inconsistent with the other interrupt attribute 
diagnostics used for other targets, and I don't think it adds any value to do 
so. I don't think it makes sense to have the attribute mark the declaration as 
ill-formed either -- attributes are usually side information to the declaration 
(otherwise we implement them as keywords).


http://reviews.llvm.org/D15709



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to