aaron.ballman added inline comments.

================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:297-298
+def err_anyx86_interrupt_regsave : Error<
+  "interrupt service routine may only call routine"
+  " with attribute no_caller_saved_registers">;
 def warn_arm_interrupt_calling_convention : Warning<
----------------
The diagnostic wording needs a bit more updating though, see below.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:6566
+        ((!FDecl || !FDecl->hasAttr<AnyX86NoCallerSavedRegistersAttr>()))) {
+      Diag(Fn->getExprLoc(), diag::err_anyx86_interrupt_regsave);
+    }
----------------
I think we should pass in `FDecl` when emitting the diagnostic because it's 
possible that there are multiple function calls where only one is problematic. 
e.g.,
```
__attribute__((interrupt)) void fooA(void) {
  fine(okay(12), bad(14)); // Would be nice to identify 'bad' as the issue
}
```
However, I'm not certain what to say when `FDecl` is null (I don't know what 
circumstances that happens).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97764/new/

https://reviews.llvm.org/D97764

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

Reply via email to