1//= ObjCNoReturn.h - Handling of Cocoa APIs known not to return --*- C++ -*---//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements special handling of recognizing ObjC API hooks that
11// do not return but aren't marked as such in API headers.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_ANALYSIS_DS_OBJCNORETURN
16#define LLVM_CLANG_ANALYSIS_DS_OBJCNORETURN
17
18#include "clang/Basic/IdentifierTable.h"
19
20namespace clang {
21
22class ASTContext;
23class ObjCMessageExpr;
24
25class ObjCNoReturn {
26  /// Cached "raise" selector.
27  Selector RaiseSel;
28
29  /// Cached identifier for "NSException".
30  IdentifierInfo *NSExceptionII;
31
32  enum { NUM_RAISE_SELECTORS = 2 };
33
34  /// Cached set of selectors in NSException that are 'noreturn'.
35  Selector NSExceptionInstanceRaiseSelectors[NUM_RAISE_SELECTORS];
36
37public:
38  ObjCNoReturn(ASTContext &C);
39
40  /// Return true if the given message expression is known to never
41  /// return.
42  bool isImplicitNoReturn(const ObjCMessageExpr *ME);
43};
44}
45
46#endif
47