[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

Andrey Karlov via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 23 04:27:29 PDT 2025


================
@@ -2648,6 +2648,14 @@ class FunctionDecl : public DeclaratorDecl,
   /// an attribute on its declaration or its type.
   bool isNoReturn() const;
 
+  /// Determines whether this function is known to never return for CFG
+  /// analysis. Checks for noreturn attributes on the function declaration
+  /// or its type, including 'analyzer_noreturn' attribute.
+  ///
+  /// Returns 'std::nullopt' if function declaration has no '*noreturn'
+  /// attributes
+  std::optional<bool> getAnalyzerNoReturn() const;
----------------
negativ wrote:

@steakhal i've renamed this function to `getAnalyzerSinkKind()`.

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


More information about the cfe-commits mailing list