[clang] [WebKit checkers] Treat asm brk as trivial (PR #155046)

Ryosuke Niwa via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 9 02:13:31 PDT 2025


================
@@ -666,6 +666,10 @@ class TrivialFunctionAnalysisVisitor
     return IsFunctionTrivial(Callee);
   }
 
+  bool VisitGCCAsmStmt(const GCCAsmStmt *AS) {
+    return AS->getAsmString() == "brk #0xc471";
----------------
rniwa wrote:

We could consider stripping whitespace but it's probably not necessary for a WebKit specific checker since we would never add random whitespace around `brk`. Having said that, in long term, a better solution would be to provide a way to annotate that a function causes the program to terminate.

https://github.com/llvm/llvm-project/pull/155046


More information about the cfe-commits mailing list