clang API Documentation

ObjCNoReturn.h
Go to the documentation of this file.
00001 //= ObjCNoReturn.h - Handling of Cocoa APIs known not to return --*- C++ -*---//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements special handling of recognizing ObjC API hooks that
00011 // do not return but aren't marked as such in API headers.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_CLANG_ANALYSIS_DOMAINSPECIFIC_OBJCNORETURN_H
00016 #define LLVM_CLANG_ANALYSIS_DOMAINSPECIFIC_OBJCNORETURN_H
00017 
00018 #include "clang/Basic/IdentifierTable.h"
00019 
00020 namespace clang {
00021 
00022 class ASTContext;
00023 class ObjCMessageExpr;
00024   
00025 class ObjCNoReturn {
00026   /// Cached "raise" selector.
00027   Selector RaiseSel;
00028 
00029   /// Cached identifier for "NSException".
00030   IdentifierInfo *NSExceptionII;
00031 
00032   enum { NUM_RAISE_SELECTORS = 2 };
00033 
00034   /// Cached set of selectors in NSException that are 'noreturn'.
00035   Selector NSExceptionInstanceRaiseSelectors[NUM_RAISE_SELECTORS];
00036 
00037 public:
00038   ObjCNoReturn(ASTContext &C);
00039   
00040   /// Return true if the given message expression is known to never
00041   /// return.
00042   bool isImplicitNoReturn(const ObjCMessageExpr *ME);
00043 };
00044 }
00045 
00046 #endif