1 //= ObjCNoReturn.h - Handling of Cocoa APIs known not to return --*- C++ -*---//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements special handling of recognizing ObjC API hooks that
10 // do not return but aren't marked as such in API headers.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_ANALYSIS_DOMAINSPECIFIC_OBJCNORETURN_H
15 #define LLVM_CLANG_ANALYSIS_DOMAINSPECIFIC_OBJCNORETURN_H
17 #include "clang/Basic/IdentifierTable.h"
22 class ObjCMessageExpr;
25 /// Cached "raise" selector.
28 /// Cached identifier for "NSException".
29 IdentifierInfo *NSExceptionII;
31 enum { NUM_RAISE_SELECTORS = 2 };
33 /// Cached set of selectors in NSException that are 'noreturn'.
34 Selector NSExceptionInstanceRaiseSelectors[NUM_RAISE_SELECTORS];
37 ObjCNoReturn(ASTContext &C);
39 /// Return true if the given message expression is known to never
41 bool isImplicitNoReturn(const ObjCMessageExpr *ME);