003 File Manager
Current Path:
/usr/src/contrib/llvm-project/clang/lib/Analysis
usr
/
src
/
contrib
/
llvm-project
/
clang
/
lib
/
Analysis
/
📁
..
📄
AnalysisDeclContext.cpp
(20.62 KB)
📄
BodyFarm.cpp
(30.09 KB)
📄
CFG.cpp
(199.8 KB)
📄
CFGReachabilityAnalysis.cpp
(2.55 KB)
📄
CFGStmtMap.cpp
(2.37 KB)
📄
CallGraph.cpp
(7.69 KB)
📄
CloneDetection.cpp
(22.11 KB)
📄
CocoaConventions.cpp
(4.49 KB)
📄
CodeInjector.cpp
(501 B)
📄
ConstructionContext.cpp
(9.16 KB)
📄
Consumed.cpp
(43.16 KB)
📄
Dominators.cpp
(611 B)
📄
ExprMutationAnalyzer.cpp
(19.82 KB)
📄
LiveVariables.cpp
(20.74 KB)
📄
ObjCNoReturn.cpp
(1.95 KB)
📄
PathDiagnostic.cpp
(42.18 KB)
📄
PostOrderCFGView.cpp
(1.74 KB)
📄
ProgramPoint.cpp
(7.59 KB)
📄
ReachableCode.cpp
(24.67 KB)
📄
RetainSummaryManager.cpp
(47.54 KB)
📄
ThreadSafety.cpp
(91.72 KB)
📄
ThreadSafetyCommon.cpp
(33.56 KB)
📄
ThreadSafetyLogical.cpp
(4.1 KB)
📄
ThreadSafetyTIL.cpp
(11.12 KB)
📄
UninitializedValues.cpp
(31.88 KB)
📁
plugins
Editing: ObjCNoReturn.cpp
//= ObjCNoReturn.cpp - Handling of Cocoa APIs known not to return --*- C++ -*--- // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements special handling of recognizing ObjC API hooks that // do not return but aren't marked as such in API headers. // //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" #include "clang/AST/ExprObjC.h" #include "clang/Analysis/DomainSpecific/ObjCNoReturn.h" using namespace clang; static bool isSubclass(const ObjCInterfaceDecl *Class, IdentifierInfo *II) { if (!Class) return false; if (Class->getIdentifier() == II) return true; return isSubclass(Class->getSuperClass(), II); } ObjCNoReturn::ObjCNoReturn(ASTContext &C) : RaiseSel(GetNullarySelector("raise", C)), NSExceptionII(&C.Idents.get("NSException")) { // Generate selectors. SmallVector<IdentifierInfo*, 3> II; // raise:format: II.push_back(&C.Idents.get("raise")); II.push_back(&C.Idents.get("format")); NSExceptionInstanceRaiseSelectors[0] = C.Selectors.getSelector(II.size(), &II[0]); // raise:format:arguments: II.push_back(&C.Idents.get("arguments")); NSExceptionInstanceRaiseSelectors[1] = C.Selectors.getSelector(II.size(), &II[0]); } bool ObjCNoReturn::isImplicitNoReturn(const ObjCMessageExpr *ME) { Selector S = ME->getSelector(); if (ME->isInstanceMessage()) { // Check for the "raise" message. return S == RaiseSel; } if (const ObjCInterfaceDecl *ID = ME->getReceiverInterface()) { if (isSubclass(ID, NSExceptionII)) { for (unsigned i = 0; i < NUM_RAISE_SELECTORS; ++i) { if (S == NSExceptionInstanceRaiseSelectors[i]) return true; } } } return false; }
Upload File
Create Folder