================
@@ -2833,8 +2834,37 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, 
AddStmtChoice asc) {
     if (!FD->isVariadic())
       findConstructionContextsForArguments(C);
 
-    if (FD->isNoReturn() || C->isBuiltinAssumeFalse(*Context))
-      NoReturn = true;
+    if (!NoReturn)
+      NoReturn = FD->isAnalyzerNoReturn() || C->isBuiltinAssumeFalse(*Context);
+
+    // Some well-known 'noreturn' functions
+    if (!NoReturn)
+      NoReturn = llvm::StringSwitch<bool>(FD->getQualifiedNameAsString())
----------------
Xazax-hun wrote:

@AaronBallman I wonder how you feel about having a list of well known (non 
standard library) functions hardcoded in the compiler? 

I wonder if we want to have a more principled approach here long term, e.g., 
having one place in the compiler that injects annotations (like noreturn), and 
the rest of the code paths only handling that one annotation. 


https://github.com/llvm/llvm-project/pull/146355
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to