[PATCH] D15709: [X86] Support 'interrupt' attribute for x86
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 3 08:54:53 PST 2016
rjmccall 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|"
----------------
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.
http://reviews.llvm.org/D15709
More information about the cfe-commits
mailing list