clang  6.0.0svn
ObjCNoReturn.h
Go to the documentation of this file.
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_DOMAINSPECIFIC_OBJCNORETURN_H
16 #define LLVM_CLANG_ANALYSIS_DOMAINSPECIFIC_OBJCNORETURN_H
17 
19 
20 namespace clang {
21 
22 class ASTContext;
23 class ObjCMessageExpr;
24 
25 class 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 
37 public:
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
Smart pointer class that efficiently represents Objective-C method names.
One of these records is kept for each identifier that is lexed.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:128
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:860
Dataflow Directional Tag Classes.
bool isImplicitNoReturn(const ObjCMessageExpr *ME)
Return true if the given message expression is known to never return.
ObjCNoReturn(ASTContext &C)