Go to the documentation of this file.
25 #include "llvm/IR/IntrinsicInst.h"
26 #include "llvm/IR/Intrinsics.h"
27 #include "llvm/IR/IntrinsicsWebAssembly.h"
28 #include "llvm/Support/SaveAndRestore.h"
30 using namespace clang;
31 using namespace CodeGen;
36 llvm::FunctionType *FTy =
45 llvm::FunctionType *FTy =
54 llvm::FunctionType *FTy =
55 llvm::FunctionType::get(
VoidTy,
false);
62 name =
"_ZSt9terminatev";
66 name =
"__std_terminate";
68 name =
"?terminate@@YAXXZ";
71 name =
"objc_terminate";
79 llvm::FunctionType *FTy =
121 const llvm::Triple &T =
Target.getTriple();
122 if (T.isWindowsMSVCEnvironment())
135 const llvm::Triple &T =
Target.getTriple();
136 if (T.isWindowsMSVCEnvironment())
158 llvm_unreachable(
"bad runtime kind");
163 const llvm::Triple &T =
Target.getTriple();
164 if (T.isWindowsMSVCEnvironment())
183 if (
Target.getTriple().isWindowsMSVCEnvironment())
209 llvm_unreachable(
"bad runtime kind");
213 if (T.getArch() == llvm::Triple::x86)
241 return get(CGF.
CGM, dyn_cast_or_null<FunctionDecl>(FD));
248 llvm::AttributeList(),
true);
254 llvm::PointerType* Int8PtrTy = llvm::PointerType::get(
258 return llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(Fn.getCallee()),
264 for (
unsigned I = 0, E = LPI->getNumClauses(); I != E; ++I) {
267 llvm::Value *Val = LPI->getClause(I)->stripPointerCasts();
268 if (LPI->isCatch(I)) {
270 if (llvm::GlobalVariable *GV = dyn_cast<llvm::GlobalVariable>(Val))
273 if (GV->getName().startswith(
"OBJC_EHTYPE"))
277 llvm::Constant *CVal = cast<llvm::Constant>(Val);
278 for (llvm::User::op_iterator
279 II = CVal->op_begin(), IE = CVal->op_end(); II != IE; ++II) {
280 if (llvm::GlobalVariable *GV =
281 cast<llvm::GlobalVariable>((*II)->stripPointerCasts()))
284 if (GV->getName().startswith(
"OBJC_EHTYPE"))
295 for (llvm::User *
U : Fn->users()) {
297 if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(
U)) {
298 if (CE->getOpcode() != llvm::Instruction::BitCast)
return false;
305 llvm::Function *F = dyn_cast<llvm::Function>(
U);
306 if (!F)
return false;
308 for (
auto BB = F->begin(), E = F->end(); BB != E; ++BB) {
309 if (BB->isLandingPad())
322 void CodeGenModule::SimplifyPersonality() {
324 if (!LangOpts.CPlusPlus || !LangOpts.ObjC || !LangOpts.Exceptions)
337 assert(std::strcmp(
ObjCXX.PersonalityFn,
CXX.PersonalityFn) != 0 &&
338 "Different EHPersonalities using the same personality function.");
343 if (!Fn || Fn->use_empty())
return;
353 if (Fn->getType() != CXXFn.getCallee()->getType())
356 Fn->replaceAllUsesWith(CXXFn.getCallee());
357 Fn->eraseFromParent();
364 return llvm::ConstantPointerNull::get(CGF.
Int8PtrTy);
406 cast<llvm::Instruction>(typedAddr.
getPointer()));
430 bool KeepInsertionPoint) {
432 QualType ThrowType = SubExpr->getType();
446 if (KeepInsertionPoint)
454 const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
457 if (
const CapturedDecl* CD = dyn_cast_or_null<CapturedDecl>(D)) {
484 diag::warn_wasm_dynamic_exception_spec_ignored)
491 for (
unsigned I = 0; I != NumExceptions; ++I) {
496 Filter->setFilter(I, EHType);
505 if (!dispatchBlock)
return;
506 if (dispatchBlock->use_empty()) {
507 delete dispatchBlock;
522 CGF.
Builder.CreateICmpSLT(selector, zero,
"ehspec.fails");
523 CGF.
Builder.CreateCondBr(failsFilter, unexpectedBB,
535 ->setDoesNotReturn();
536 CGF.
Builder.CreateUnreachable();
543 const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
546 if (
const CapturedDecl* CD = dyn_cast_or_null<CapturedDecl>(D)) {
585 unsigned NumHandlers = S.getNumHandlers();
588 for (
unsigned I = 0; I != NumHandlers; ++I) {
592 if (C->getExceptionDecl()) {
601 C->getCaughtType().getNonReferenceType(), CaughtTypeQuals);
608 CaughtType, C->getCaughtType());
631 if (!dispatchBlock) {
661 return dispatchBlock;
676 return DispatchBlock;
686 DispatchBlock->setName(
"catch.dispatch");
690 DispatchBlock->setName(
"ehcleanup");
694 llvm_unreachable(
"exception specifications not handled yet!");
697 DispatchBlock->setName(
"terminate");
701 return DispatchBlock;
708 switch (S.getKind()) {
710 return !cast<EHCleanupScope>(S).isEHCleanup();
717 llvm_unreachable(
"Invalid EHScope Kind!");
729 if (!LO.Exceptions || LO.IgnoreExceptions) {
730 if (!LO.Borland && !LO.MicrosoftExt)
737 if (LO.CUDA && LO.CUDAIsDevice)
747 if (!
CurFn->hasPersonalityFn())
763 ir->setCachedLandingPad(LP);
773 "LandingPad should not be emitted when -fignore-exceptions are in "
776 switch (innermostEHScope.
getKind()) {
788 CGBuilderTy::InsertPoint savedIP =
Builder.saveAndClearIP();
795 llvm::LandingPadInst *LPadInst =
809 bool hasCatchAll =
false;
810 bool hasCleanup =
false;
811 bool hasFilter =
false;
817 switch (I->getKind()) {
820 hasCleanup = (hasCleanup || cast<EHCleanupScope>(*I).isEHCleanup());
824 assert(I.next() ==
EHStack.
end() &&
"EH filter is not end of EH stack");
825 assert(!hasCatchAll &&
"EH filter reached after catch-all");
832 for (
unsigned i = 0, e = filter.
getNumFilters(); i != e; ++i)
833 filterTypes.push_back(filter.
getFilter(i));
839 assert(!hasCatchAll);
848 for (
unsigned hi = 0, he = catchScope.
getNumHandlers(); hi != he; ++hi) {
851 "landingpads do not support catch handler flags");
855 assert(!hasCatchAll);
861 if (catchTypes.insert(handler.
Type.
RTTI).second)
863 LPadInst->addClause(handler.
Type.
RTTI);
869 assert(!(hasCatchAll && hasFilter));
875 }
else if (hasFilter) {
880 llvm::ArrayType *AType =
881 llvm::ArrayType::get(!filterTypes.empty() ?
885 for (
unsigned i = 0, e = filterTypes.size(); i != e; ++i)
886 Filters.push_back(cast<llvm::Constant>(filterTypes[i]));
887 llvm::Constant *FilterArray = llvm::ConstantArray::get(AType, Filters);
888 LPadInst->addClause(FilterArray);
892 LPadInst->setCleanup(
true);
895 }
else if (hasCleanup) {
896 LPadInst->setCleanup(
true);
899 assert((LPadInst->getNumClauses() > 0 || LPadInst->isCleanup()) &&
900 "landingpad instruction has no clauses!");
913 assert(DispatchBlock);
915 CGBuilderTy::InsertPoint SavedIP = CGF.
Builder.saveIP();
921 llvm::BasicBlock *UnwindBB =
925 llvm::CatchSwitchInst *CatchSwitch =
926 CGF.
Builder.CreateCatchSwitch(ParentPad, UnwindBB, NumHandlers);
929 for (
unsigned I = 0; I < NumHandlers; ++I) {
941 llvm::Constant::getNullValue(CGF.
VoidPtrTy)});
946 CatchSwitch->addHandler(Handler.
Block);
948 CGF.
Builder.restoreIP(SavedIP);
957 assert(DispatchBlock);
959 CGBuilderTy::InsertPoint SavedIP = CGF.
Builder.saveIP();
965 llvm::BasicBlock *UnwindBB =
969 llvm::CatchSwitchInst *CatchSwitch =
970 CGF.
Builder.CreateCatchSwitch(ParentPad, UnwindBB, NumHandlers);
974 llvm::BasicBlock *WasmCatchStartBlock = CGF.
createBasicBlock(
"catch.start");
975 CatchSwitch->addHandler(WasmCatchStartBlock);
980 for (
unsigned I = 0, E = NumHandlers; I < E; ++I) {
985 CatchTypes.push_back(
TypeInfo.RTTI);
987 auto *CPI = CGF.
Builder.CreateCatchPad(CatchSwitch, CatchTypes);
992 llvm::Function *GetExnFn =
994 llvm::Function *GetSelectorFn =
996 llvm::CallInst *Exn = CGF.
Builder.CreateCall(GetExnFn, CPI);
1000 llvm::Function *TypeIDFn = CGF.
CGM.
getIntrinsic(llvm::Intrinsic::eh_typeid_for);
1006 CGF.
Builder.restoreIP(SavedIP);
1011 for (
unsigned I = 0, E = NumHandlers;; ++I) {
1012 assert(I < E &&
"ran off end of handlers!");
1019 llvm::BasicBlock *NextBlock;
1021 bool EmitNextBlock =
false, NextIsEnd =
false;
1028 EmitNextBlock =
true;
1040 EmitNextBlock =
true;
1044 llvm::CallInst *TypeIndex = CGF.
Builder.CreateCall(TypeIDFn,
TypeInfo.RTTI);
1045 TypeIndex->setDoesNotThrow();
1049 CGF.
Builder.CreateCondBr(MatchesTypeIndex, Handler.
Block, NextBlock);
1057 CGF.
Builder.restoreIP(SavedIP);
1070 assert(dispatchBlock);
1080 CGBuilderTy::InsertPoint savedIP = CGF.
Builder.saveIP();
1084 llvm::Function *llvm_eh_typeid_for =
1092 assert(i < e &&
"ran off end of handlers!");
1097 "landingpads do not support catch handler flags");
1098 assert(typeValue &&
"fell into catch-all case!");
1103 llvm::BasicBlock *nextBlock;
1124 llvm::CallInst *typeIndex =
1125 CGF.
Builder.CreateCall(llvm_eh_typeid_for, typeValue);
1126 typeIndex->setDoesNotThrow();
1129 CGF.
Builder.CreateICmpEQ(selector, typeIndex,
"matches");
1130 CGF.
Builder.CreateCondBr(matchesTypeIndex, handler.
Block, nextBlock);
1134 CGF.
Builder.restoreIP(savedIP);
1150 unsigned NumHandlers = S.getNumHandlers();
1168 CatchScope.
begin(), CatchScope.
begin() + NumHandlers);
1181 bool doImplicitRethrow =
false;
1183 doImplicitRethrow = isa<CXXDestructorDecl>(
CurCodeDecl) ||
1191 llvm::BasicBlock *WasmCatchStartBlock =
nullptr;
1194 cast<llvm::CatchSwitchInst>(DispatchBlock->getFirstNonPHI());
1195 WasmCatchStartBlock = CatchSwitch->hasUnwindDest()
1196 ? CatchSwitch->getSuccessor(1)
1197 : CatchSwitch->getSuccessor(0);
1198 auto *CPI = cast<llvm::CatchPadInst>(WasmCatchStartBlock->getFirstNonPHI());
1209 bool HasCatchAll =
false;
1210 for (
unsigned I = NumHandlers; I != 0; --I) {
1211 HasCatchAll |= Handlers[I - 1].isCatchAll();
1212 llvm::BasicBlock *CatchBlock = Handlers[I-1].Block;
1245 Builder.ClearInsertionPoint();
1261 assert(WasmCatchStartBlock);
1266 llvm::BasicBlock *RethrowBlock = WasmCatchStartBlock;
1267 while (llvm::Instruction *TI = RethrowBlock->getTerminator()) {
1268 auto *BI = cast<llvm::BranchInst>(TI);
1269 assert(BI->isConditional());
1270 RethrowBlock = BI->getSuccessor(1);
1272 assert(RethrowBlock != WasmCatchStartBlock && RethrowBlock->empty());
1273 Builder.SetInsertPoint(RethrowBlock);
1274 llvm::Function *RethrowInCatchFn =
1286 llvm::FunctionCallee EndCatchFn;
1288 llvm::FunctionCallee EndCatchFn)
1289 : ForEHVar(ForEHVar), EndCatchFn(EndCatchFn) {}
1293 llvm::BasicBlock *CleanupContBB =
1298 CGF.
Builder.CreateCondBr(ShouldEndCatch, EndCatchBB, CleanupContBB);
1308 llvm::FunctionCallee EndCatchFn;
1309 llvm::FunctionCallee RethrowFn;
1313 llvm::FunctionCallee EndCatchFn,
1314 llvm::FunctionCallee RethrowFn,
llvm::Value *SavedExnVar)
1315 : Body(Body), ForEHVar(ForEHVar), EndCatchFn(EndCatchFn),
1316 RethrowFn(RethrowFn), SavedExnVar(SavedExnVar) {}
1322 ForEHVar, EndCatchFn);
1328 "cleanup.dest.saved");
1341 CGF.
Builder.CreateCondBr(ShouldRethrow, RethrowBB, ContBB);
1351 CGF.
Builder.CreateUnreachable();
1364 CGBuilderTy::InsertPoint SavedIP = CGF.
Builder.saveAndClearIP();
1366 CGF.
Builder.restoreIP(SavedIP);
1380 llvm::FunctionCallee beginCatchFn,
1381 llvm::FunctionCallee endCatchFn,
1382 llvm::FunctionCallee rethrowFn) {
1383 assert((!!beginCatchFn) == (!!endCatchFn) &&
1384 "begin/end catch functions not paired");
1385 assert(rethrowFn &&
"rethrow function is required");
1387 BeginCatchFn = beginCatchFn;
1395 llvm::FunctionType *rethrowFnTy = rethrowFn.getFunctionType();
1396 SavedExnVar =
nullptr;
1397 if (rethrowFnTy->getNumParams())
1423 ForEHVar, endCatchFn,
1424 rethrowFn, SavedExnVar);
1440 if (catchBB->use_empty()) {
1443 CGBuilderTy::InsertPoint savedIP = CGF.
Builder.saveAndClearIP();
1466 CGF.
Builder.restoreIP(savedIP);
1474 if (TerminateLandingPad)
1475 return TerminateLandingPad;
1477 CGBuilderTy::InsertPoint SavedIP =
Builder.saveAndClearIP();
1481 Builder.SetInsertPoint(TerminateLandingPad);
1486 if (!
CurFn->hasPersonalityFn())
1489 llvm::LandingPadInst *LPadInst =
1495 Exn =
Builder.CreateExtractValue(LPadInst, 0);
1496 llvm::CallInst *terminateCall =
1498 terminateCall->setDoesNotReturn();
1504 return TerminateLandingPad;
1508 if (TerminateHandler)
1509 return TerminateHandler;
1514 CGBuilderTy::InsertPoint SavedIP =
Builder.saveAndClearIP();
1515 Builder.SetInsertPoint(TerminateHandler);
1520 llvm::CallInst *terminateCall =
1522 terminateCall->setDoesNotReturn();
1528 return TerminateHandler;
1533 "use getTerminateLandingPad for non-funclet EH");
1536 if (TerminateFunclet)
1537 return TerminateFunclet;
1539 CGBuilderTy::InsertPoint SavedIP =
Builder.saveAndClearIP();
1544 Builder.SetInsertPoint(TerminateFunclet);
1556 llvm::CallInst *terminateCall =
1558 terminateCall->setDoesNotReturn();
1564 return TerminateFunclet;
1570 CGBuilderTy::InsertPoint SavedIP =
Builder.saveIP();
1581 if (RethrowName !=
nullptr && !isCleanup) {
1593 llvm::Type *LPadType = llvm::StructType::get(Exn->getType(), Sel->getType());
1594 llvm::Value *LPadVal = llvm::UndefValue::get(LPadType);
1595 LPadVal =
Builder.CreateInsertValue(LPadVal, Exn, 0,
"lpad.val");
1596 LPadVal =
Builder.CreateInsertValue(LPadVal, Sel, 1,
"lpad.val");
1598 Builder.CreateResume(LPadVal);
1612 if (!TryExit.
getBlock()->use_empty())
1622 llvm::Function *OutlinedFinally;
1623 PerformSEHFinally(llvm::Function *OutlinedFinally)
1624 : OutlinedFinally(OutlinedFinally) {}
1637 FP = &CGF.
CurFn->arg_begin()[1];
1639 llvm::Function *LocalAddrFn =
1641 FP = CGF.
Builder.CreateCall(LocalAddrFn);
1645 llvm::ConstantInt::get(CGF.
ConvertType(ArgTys[0]), F.isForEHCleanup());
1652 if (!F.isForEHCleanup() && F.hasExitSwitch()) {
1683 bool foundCaptures() {
1684 return !Captures.empty() || SEHCodeSlot.
isValid();
1687 void Visit(
const Stmt *S) {
1690 for (
const Stmt *Child : S->children())
1698 Captures.insert(ParentThis);
1700 const auto *D = dyn_cast<VarDecl>(E->
getDecl());
1701 if (D && D->isLocalVarDeclOrParm() && D->hasLocalStorage())
1706 Captures.insert(ParentThis);
1709 void VisitCallExpr(
const CallExpr *E) {
1716 case Builtin::BI__exception_code:
1717 case Builtin::BI_exception_code:
1732 llvm::CallInst *RecoverCall =
nullptr;
1734 if (
auto *ParentAlloca = dyn_cast<llvm::AllocaInst>(ParentVar.
getPointer())) {
1737 auto InsertPair =
ParentCGF.EscapedLocals.insert(
1738 std::make_pair(ParentAlloca,
ParentCGF.EscapedLocals.size()));
1739 int FrameEscapeIdx = InsertPair.first->second;
1741 llvm::Function *FrameRecoverFn = llvm::Intrinsic::getDeclaration(
1743 llvm::Constant *ParentI8Fn =
1745 RecoverCall =
Builder.CreateCall(
1746 FrameRecoverFn, {ParentI8Fn, ParentFP,
1747 llvm::ConstantInt::get(
Int32Ty, FrameEscapeIdx)});
1753 auto *ParentRecover =
1754 cast<llvm::IntrinsicInst>(ParentVar.
getPointer()->stripPointerCasts());
1755 assert(ParentRecover->getIntrinsicID() == llvm::Intrinsic::localrecover &&
1756 "expected alloca or localrecover in parent LocalDeclMap");
1757 RecoverCall = cast<llvm::CallInst>(ParentRecover->clone());
1758 RecoverCall->setArgOperand(1, ParentFP);
1765 ChildVar->setName(ParentVar.
getName());
1770 const Stmt *OutlinedStmt,
1774 Finder.Visit(OutlinedStmt);
1778 if (!Finder.foundCaptures() &&
1793 {Builder.getInt32(1)});
1797 auto AI =
CurFn->arg_begin();
1807 llvm::Function *RecoverFPIntrin =
1809 llvm::Constant *ParentI8Fn =
1811 ParentFP =
Builder.CreateCall(RecoverFPIntrin, {ParentI8Fn, EntryFP});
1823 llvm::AllocaInst *FramePtrAddrAlloca =
nullptr;
1824 for (
auto &I :
ParentCGF.LocalDeclMap) {
1825 const VarDecl *D = cast<VarDecl>(I.first);
1826 if (isa<ImplicitParamDecl>(D) &&
1828 assert(D->
getName().startswith(
"frame_pointer"));
1829 FramePtrAddrAlloca = cast<llvm::AllocaInst>(I.second.getPointer());
1833 assert(FramePtrAddrAlloca);
1834 auto InsertPair =
ParentCGF.EscapedLocals.insert(
1835 std::make_pair(FramePtrAddrAlloca,
ParentCGF.EscapedLocals.size()));
1836 int FrameEscapeIdx = InsertPair.first->second;
1844 llvm::Function *FrameRecoverFn = llvm::Intrinsic::getDeclaration(
1846 llvm::Constant *ParentI8Fn =
1848 ParentFP =
Builder.CreateCall(
1849 FrameRecoverFn, {ParentI8Fn, ParentFP,
1850 llvm::ConstantInt::get(
Int32Ty, FrameEscapeIdx)});
1857 for (
const VarDecl *VD : Finder.Captures) {
1863 "captured non-local variable");
1873 auto I =
ParentCGF.LocalDeclMap.find(VD);
1877 Address ParentVar = I->second;
1880 setAddrOfLocalVar(VD, Recovered);
1882 if (isa<ImplicitParamDecl>(VD)) {
1883 CXXABIThisAlignment =
ParentCGF.CXXABIThisAlignment;
1884 CXXThisAlignment =
ParentCGF.CXXThisAlignment;
1899 CXXThisValue = CXXABIThisValue;
1904 if (Finder.SEHCodeSlot.isValid()) {
1918 const Stmt *OutlinedStmt) {
1924 llvm::raw_svector_ostream OS(Name);
1926 assert(ParentSEHFn &&
"No CurSEHParent!");
1941 &
getContext().Idents.get(
"exception_pointers"),
1946 &
getContext().Idents.get(
"abnormal_termination"),
1961 llvm::Function *Fn = llvm::Function::Create(
2038 llvm::Type *RecordTy =
CGM.
Int32Ty->getPointerTo();
2039 llvm::Type *PtrsTy = llvm::StructType::get(RecordTy,
CGM.
VoidPtrTy);
2044 assert(!
SEHCodeSlotStack.empty() &&
"emitting EH code outside of __except");
2052 return llvm::UndefValue::get(
Int8PtrTy);
2058 assert(!
SEHCodeSlotStack.empty() &&
"emitting EH code outside of __except");
2065 auto AI =
CurFn->arg_begin();
2070 llvm::Function *FinallyFunc) {
2071 EHStack.pushCleanup<PerformSEHFinally>(
Kind, FinallyFunc);
2079 llvm::Function *FinallyFunc =
2108 llvm::Function *FilterFunc =
2110 llvm::Constant *OpaqueFunc =
2111 llvm::ConstantExpr::getBitCast(FilterFunc,
Int8PtrTy);
2117 if (S.getFinallyHandler()) {
2124 assert(Except &&
"__try must have __finally xor __except");
2155 llvm::CatchPadInst *CPI =
2156 cast<llvm::CatchPadInst>(CatchPadBB->getFirstNonPHI());
2158 Builder.CreateCatchRet(CPI, ExceptBB);
2163 llvm::Function *SEHCodeIntrin =
2192 Builder.ClearInsertionPoint();
Address getEHSelectorSlot()
bool isWasmPersonality() const
@ InternalLinkage
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
static void emitCatchPadBlock(CodeGenFunction &CGF, EHCatchScope &CatchScope)
llvm::Type * ConvertTypeForMem(QualType T)
static const EHPersonality & getSEHPersonalityMSVC(const llvm::Triple &T)
static const EHPersonality GNU_C_SJLJ
void EmitBlockAfterUses(llvm::BasicBlock *BB)
EmitBlockAfterUses - Emit the given block somewhere hopefully near its uses, and leave the insertion ...
bool hasSEHExceptions() const
bool isSEHTryScope() const
Returns true inside SEH __try blocks.
void EmitCXXTryStmt(const CXXTryStmt &S)
llvm::PointerType * Int8PtrTy
static const EHPersonality & getObjCPersonality(const TargetInfo &Target, const LangOptions &L)
static const EHPersonality NeXT_ObjC
void EmitEndEHSpec(const Decl *D)
EmitEndEHSpec - Emit the end of the exception spec.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
llvm::IntegerType * IntTy
int
llvm::FunctionCallee CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList(), bool Local=false, bool AssumeConvergent=false)
Create or return a runtime function declaration with the specified type and name.
static const EHPersonality GNU_C
llvm::BasicBlock * getTerminateLandingPad()
getTerminateLandingPad - Return a landing pad that just calls terminate.
static const EHPersonality GNUstep_ObjC
llvm::Value * EmitSEHAbnormalTermination()
@ GCC
'gcc' is the Objective-C runtime shipped with GCC, implementing a fragile Objective-C ABI
static const EHPersonality GNU_CPlusPlus_SEH
bool currentFunctionUsesSEHTry() const
virtual CatchTypeInfo getAddrOfCXXCatchHandlerType(QualType Ty, QualType CatchHandlerType)=0
llvm::DenseMap< const VarDecl *, FieldDecl * > LambdaCaptureFields
class EHFilterScope * pushFilter(unsigned NumFilters)
Push an exceptions filter on the stack.
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")
CharUnits getAlignment() const
Return the alignment of this pointer.
Encodes a location in the source.
void SetInternalFunctionAttributes(GlobalDecl GD, llvm::Function *F, const CGFunctionInfo &FI)
Set the attributes on the LLVM function for the given decl and function info.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
MangleContext & getMangleContext()
Gets the mangle context.
Address getAddress(CodeGenFunction &CGF) const
This represents a decl that may have a name.
class EHCatchScope * pushCatch(unsigned NumHandlers)
Push a set of catch handlers on the stack.
void setCatchAllHandler(unsigned I, llvm::BasicBlock *Block)
llvm::BasicBlock * getCachedLandingPad() const
void PopCleanupBlock(bool FallThroughIsBranchThrough=false)
PopCleanupBlock - Will pop the cleanup entry on the stack and process all branch fixups.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
void enter(CodeGenFunction &CGF, const Stmt *Finally, llvm::FunctionCallee beginCatchFn, llvm::FunctionCallee endCatchFn, llvm::FunctionCallee rethrowFn)
Enters a finally block for an implementation using zero-cost exceptions.
SourceRange getExceptionSpecSourceRange() const
Attempt to compute an informative source range covering the function exception specification,...
CharUnits getPointerAlign() const
A (possibly-)qualified type.
A protected scope for zero-cost EH handling.
const Handler & getHandler(unsigned I) const
ASTContext & getContext() const
llvm::BasicBlock * getTerminateHandler()
getTerminateHandler - Return a handler (not a landing pad, just a catch handler) that just calls term...
@ EST_Dynamic
throw(T1, T2)
The collection of all-type qualifiers we support.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
LValue EmitLValueForLambdaField(const FieldDecl *Field)
Given that we are currently emitting a lambda, emit an l-value for one of its members.
Exposes information about the current target.
llvm::Value * SEHInfo
Value returned by __exception_info intrinsic.
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
static const EHPersonality GNU_Wasm_CPlusPlus
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
static const EHPersonality GNU_ObjC_SEH
llvm::SmallVector< const JumpDest *, 2 > SEHTryEpilogueStack
bool hasEHBranches() const
const CGFunctionInfo & arrangeBuiltinFunctionDeclaration(QualType resultType, const FunctionArgList &args)
A builtin function is a freestanding function using the default C conventions.
const char * CatchallRethrowFn
void EmitNoreturnRuntimeCallOrInvoke(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args)
Emits a call or invoke to the given noreturn runtime function.
void popCatchScope()
popCatchScope - Pops the catch scope at the top of the EHScope stack, emitting any required code (oth...
llvm::Value * EmitSEHExceptionCode()
const LangOptions & getLangOpts() const
bool HaveInsertPoint() const
HaveInsertPoint - True if an insertion point is defined.
@ EHCleanup
Denotes a cleanup that should run when a scope is exited using exceptional control flow (a throw stat...
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)
CreateTempAlloca - This creates an alloca and inserts it into the entry block if ArraySize is nullptr...
bool hasTerminate() const
Does this runtime provide an objc_terminate function?
virtual void emitRethrow(CodeGenFunction &CGF, bool isNoReturn)=0
void EmitSEHExceptionCodeSave(CodeGenFunction &ParentCGF, llvm::Value *ParentFP, llvm::Value *EntryEBP)
bool hasDWARFExceptions() const
Represents the body of a CapturedStmt, and serves as its DeclContext.
const char * PersonalityFn
CharUnits getIntAlign() const
Address CreateStructGEP(Address Addr, unsigned Index, const llvm::Twine &Name="")
void EmitStmt(const Stmt *S, ArrayRef< const Attr * > Attrs=None)
EmitStmt - Emit the code for the statement.
CompoundStmt * getBlock() const
llvm::BasicBlock * getBlock() const
static const EHPersonality & get(CodeGenModule &CGM, const FunctionDecl *FD)
static const EHPersonality GNU_C_SEH
void add(RValue rvalue, QualType type)
llvm::BasicBlock * Block
The catch handler for this type.
Address CreateBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
llvm::PointerType * VoidPtrTy
static const EHPersonality & getObjCXXPersonality(const TargetInfo &Target, const LangOptions &L)
Determines the personality function to use when both C++ and Objective-C exceptions are being caught.
const VersionTuple & getVersion() const
A C++ throw-expression (C++ [except.throw]).
static llvm::FunctionCallee getUnexpectedFn(CodeGenModule &CGM)
GlobalDecl - represents a global declaration.
llvm::PointerType * AllocaInt8PtrTy
virtual CatchTypeInfo getCatchAllTypeInfo()
@ FragileMacOSX
'macosx-fragile' is the Apple-provided NeXT-derived runtime on Mac OS X platforms that use the fragil...
ReturnValueSlot - Contains the address where the return value of a function can be stored,...
static llvm::FunctionCallee getPersonalityFn(CodeGenModule &CGM, const EHPersonality &Personality)
bool usesFuncletPads() const
Does this personality use landingpads or the family of pad instructions designed to form funclets?
virtual void EmitThrowStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtThrowStmt &S, bool ClearInsertionPoint=true)=0
unsigned getNumHandlers() const
Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited.
A scope which attempts to handle some, possibly all, types of exceptions.
llvm::BasicBlock * getInvokeDestImpl()
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
llvm::BasicBlock * EHResumeBlock
EHResumeBlock - Unified block containing a call to llvm.eh.resume.
@ MacOSX
'macosx' is the Apple-provided NeXT-derived runtime on Mac OS X platforms that use the non-fragile AB...
Information for lazily generating a cleanup.
llvm::Value * EmitSEHExceptionInfo()
SmallVector< Address, 1 > SEHCodeSlotStack
A stack of exception code slots.
clang::ObjCRuntime ObjCRuntime
CGObjCRuntime & getObjCRuntime()
Return a reference to the configured Objective-C runtime.
void pushSEHCleanup(CleanupKind kind, llvm::Function *FinallyFunc)
llvm::StoreInst * CreateAlignedStore(llvm::Value *Val, llvm::Value *Addr, CharUnits Align, bool IsVolatile=false)
void EmitCapturedLocals(CodeGenFunction &ParentCGF, const Stmt *OutlinedStmt, bool IsFilter)
Scan the outlined statement for captures from the parent function.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
llvm::StringRef getName() const
Return the IR name of the pointer value.
Represents Objective-C's @throw statement.
bool hasWasmExceptions() const
CatchTypeInfo Type
A type info value, or null (C++ null, not an LLVM null pointer) for a catch-all.
const NamedDecl * CurSEHParent
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
llvm::PointerType * getType() const
Return the type of the pointer value.
static const EHPersonality GNU_ObjCXX
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
virtual void emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E)=0
llvm::CallInst * EmitRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")
void EnsureInsertPoint()
EnsureInsertPoint - Ensure that an insertion point is defined so that emitted IR has a place to go.
const T * getAs() const
Member-template getAs<specific type>'.
const TargetInfo & getTarget() const
Address getExceptionSlot()
Returns a pointer to the function's exception object and selector slot, which is assigned in every la...
void setCachedEHDispatchBlock(llvm::BasicBlock *block)
void Visit(PTR(Stmt) S, ParamTys... P)
llvm::Module & getModule() const
SourceLocation getEndLoc() const LLVM_READONLY
EHScopeStack::stable_iterator getEnclosingEHScope() const
bool empty() const
Determines whether the exception-scopes stack is empty.
llvm::AllocaInst * EHSelectorSlot
The selector slot.
static void emitCatchDispatchBlock(CodeGenFunction &CGF, EHCatchScope &catchScope)
Emit the structure of the dispatch block for the given catch scope.
bool Load(InterpState &S, CodePtr OpPC)
bool Zero(InterpState &S, CodePtr OpPC)
CanThrowResult canThrow() const
Determine whether this function type has a non-throwing exception specification.
Represents a variable declaration or definition.
static llvm::Constant * getCatchAllValue(CodeGenFunction &CGF)
Returns the value to inject into a selector to indicate the presence of a catch-all.
llvm::Value * ExceptionSlot
The exception slot.
@ WatchOS
'watchos' is a variant of iOS for Apple's watchOS.
llvm::Function * GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF, const SEHFinallyStmt &Finally)
bool IsOutlinedSEHHelper
True if the current function is an outlined SEH helper.
CodeGenTypes & getTypes()
bool hasSjLjExceptions() const
void clearHandlerBlocks()
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
void ExitSEHTryStmt(const SEHTryStmt &S)
virtual void emitBeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *C)=0
llvm::LLVMContext & getLLVMContext()
void pushTerminate()
Push a terminate handler on the stack.
ASTContext & getContext() const
iterator end() const
Returns an iterator pointing to the outermost EH scope.
@ NormalCleanup
Denotes a cleanup that should run when a scope is exited using normal control flow (falling off the e...
CXXTryStmt - A C++ try block, including all handlers.
void incrementProfileCounter(const Stmt *S, llvm::Value *StepV=nullptr)
Increment the profiler's counter for the given statement by StepV.
void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
DeactivateCleanupBlock - Deactivates the given cleanup block.
void FinishFunction(SourceLocation EndLoc=SourceLocation())
FinishFunction - Complete IR generation of the current function.
static llvm::FunctionCallee getCatchallRethrowFn(CodeGenModule &CGM, StringRef Name)
llvm::LoadInst * CreateFlagLoad(llvm::Value *Addr, const llvm::Twine &Name="")
Emit a load from an i1 flag variable.
JumpDest getJumpDestInCurrentScope(llvm::BasicBlock *Target)
The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossi...
static bool PersonalityHasOnlyCXXUses(llvm::Constant *Fn)
Check whether a personality function could reasonably be swapped for a C++ personality function.
bool requiresLandingPad() const
llvm::BasicBlock * getEHDispatchBlock(EHScopeStack::stable_iterator scope)
QualType getExceptionType(unsigned i) const
Return the ith exception type, where 0 <= i < getNumExceptions().
RValue EmitCall(const CGFunctionInfo &CallInfo, const CGCallee &Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, llvm::CallBase **callOrInvoke, SourceLocation Loc)
EmitCall - Generate a call of the given function, expecting the given result type,...
void EmitAnyExprToMem(const Expr *E, Address Location, Qualifiers Quals, bool IsInitializer)
EmitAnyExprToMem - Emits the code necessary to evaluate an arbitrary expression into the given memory...
static CGCallee forDirect(llvm::Constant *functionPtr, const CGCalleeInfo &abstractInfo=CGCalleeInfo())
bool isNeXTFamily() const
Is this runtime basically of the NeXT family of runtimes?
const TargetInfo & getTarget() const
static const EHPersonality GNU_CPlusPlus
@ ObjFW
'objfw' is the Objective-C runtime included in ObjFW
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
void EmitSEHTryStmt(const SEHTryStmt &S)
llvm::IntegerType * Int32Ty
bool isObjCObjectPointerType() const
void popFilter()
Pops an exceptions filter off the stack.
virtual llvm::CallInst * emitTerminateForUnexpectedException(CodeGenFunction &CGF, llvm::Value *Exn)
CanQualType UnsignedCharTy
static const EHPersonality & getCPersonality(const TargetInfo &Target, const LangOptions &L)
void setHandler(unsigned I, llvm::Constant *Type, llvm::BasicBlock *Block)
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.
const llvm::DataLayout & getDataLayout() const
static llvm::Constant * getOpaquePersonalityFn(CodeGenModule &CGM, const EHPersonality &Personality)
static bool LandingPadHasOnlyCXXUses(llvm::LandingPadInst *LPI)
Check whether a landingpad instruction only uses C++ features.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
void StartFunction(GlobalDecl GD, QualType RetTy, llvm::Function *Fn, const CGFunctionInfo &FnInfo, const FunctionArgList &Args, SourceLocation Loc=SourceLocation(), SourceLocation StartLoc=SourceLocation())
Emit code for the start of a function.
LValue - This represents an lvalue references.
llvm::Value * getSelectorFromSlot()
bool usesSEHTry() const
Indicates the function uses __try.
bool isPointerType() const
llvm::FunctionCallee getTerminateFn()
Get the declaration of std::terminate for the platform.
llvm::Function * GenerateSEHFilterFunction(CodeGenFunction &ParentCGF, const SEHExceptStmt &Except)
Create a stub filter function that will ultimately hold the code of the filter expression.
llvm::Value * getPointer() const
void ErrorUnsupported(const Stmt *S, const char *Type)
Print out an error that codegen doesn't support the specified stmt yet.
@ GNUstep
'gnustep' is the modern non-fragile GNUstep runtime.
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Expr * getFilterExpr() const
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
bool isLocalVarDeclOrParm() const
Similar to isLocalVarDecl but also includes parameters.
CGCXXABI & getCXXABI() const
Represents a prototype with parameter type info, e.g.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
This class organizes the cross-function state that is used while generating LLVM code.
Address recoverAddrOfEscapedLocal(CodeGenFunction &ParentCGF, Address ParentVar, llvm::Value *ParentFP)
Recovers the address of a local in a parent function.
llvm::Value * getExceptionFromSlot()
Returns the contents of the function's exception object and selector slots.
llvm::Constant * GetAddrOfRTTIDescriptor(QualType Ty, bool ForEH=false)
Get the address of the RTTI descriptor for the given type.
Decl - This represents one declaration (or definition), e.g.
static ApplyDebugLocation CreateDefaultArtificial(CodeGenFunction &CGF, SourceLocation TemporaryLocation)
Apply TemporaryLocation if it is valid.
llvm::LoadInst * CreateAlignedLoad(llvm::Type *Ty, llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")
static const EHPersonality & getCXXPersonality(const TargetInfo &Target, const LangOptions &L)
FunctionArgList - Type for representing both the decl and type of parameters to a function.
const Expr * getSubExpr() const
llvm::BasicBlock * getUnreachableBlock()
static const EHPersonality MSVC_except_handler
CodeGenFunction * ParentCGF
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
llvm::Type * ConvertType(QualType T)
llvm::BasicBlock * getEHResumeBlock(bool isCleanup)
llvm::BasicBlock * getCachedEHDispatchBlock() const
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
The basic abstraction for the target Objective-C runtime.
llvm::CallBase * EmitRuntimeCallOrInvoke(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")
Emits a call or invoke instruction to the given runtime function.
static const EHPersonality MSVC_C_specific_handler
static void emitFilterDispatchBlock(CodeGenFunction &CGF, EHFilterScope &filterScope)
Emit the dispatch block for a filter scope if necessary.
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type,...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
void EmitAnyExprToExn(const Expr *E, Address Addr)
CGFunctionInfo - Class to encapsulate the information about a function definition.
An exceptions scope which filters exceptions thrown through it.
RValue EmitLoadOfLValue(LValue V, SourceLocation Loc)
EmitLoadOfLValue - Given an expression that represents a value lvalue, this method emits the address ...
virtual void mangleSEHFilterExpression(const NamedDecl *EnclosingDecl, raw_ostream &Out)=0
Represents the this expression in C++.
stable_iterator getInnermostEHScope() const
virtual void mangleSEHFinallyBlock(const NamedDecl *EnclosingDecl, raw_ostream &Out)=0
void popCatch()
Pops a catch scope off the stack. This is private to CGException.cpp.
The exceptions personality for a function.
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
Dataflow Directional Tag Classes.
llvm::StoreInst * CreateFlagStore(bool Value, llvm::Value *Addr)
Emit a store to an i1 flag variable.
A jump destination is an abstract label, branching to which may require a jump out through normal cle...
static RValue get(llvm::Value *V)
Smart pointer class that efficiently represents Objective-C method names.
static bool isNonEHScope(const EHScope &S)
Check whether this is a non-EH scope, i.e.
Stmt - This represents one statement.
The MS C++ ABI needs a pointer to RTTI data plus some flags to describe the type of a catch handler,...
A non-stable pointer into the scope stack.
void ForceCleanup(std::initializer_list< llvm::Value ** > ValuesToReload={})
Force the emission of cleanups now, instead of waiting until this object is destroyed.
CXXCatchStmt - This represents a C++ catch block.
llvm::Value * getScalarVal() const
getScalarVal() - Return the Value* of this scalar value.
void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
static const EHPersonality MSVC_CxxFrameHandler3
DiagnosticsEngine & getDiags() const
SourceLocation getBeginLoc() const LLVM_READONLY
llvm::BasicBlock * getFuncletEHDispatchBlock(EHScopeStack::stable_iterator scope)
FieldDecl * LambdaThisCaptureField
void startOutlinedSEHHelper(CodeGenFunction &ParentCGF, bool IsFilter, const Stmt *OutlinedStmt)
Arrange a function prototype that can be called by Windows exception handling personalities.
static void emitWasmCatchPadBlock(CodeGenFunction &CGF, EHCatchScope &CatchScope)
unsigned getNumFilters() const
stable_iterator stable_begin() const
Create a stable reference to the top of the EH stack.
llvm::Instruction * CurrentFuncletPad
static llvm::FunctionCallee getFreeExceptionFn(CodeGenModule &CGM)
void EnterSEHTryStmt(const SEHTryStmt &S)
void EmitStartEHSpec(const Decl *D)
EmitStartEHSpec - Emit the start of the exception spec.
llvm::Constant * tryEmitAbstract(const Expr *E, QualType T)
Try to emit the result of the given expression as an abstract constant.
@ iOS
'ios' is the Apple-provided NeXT-derived runtime on iOS or the iOS simulator; it is always non-fragil...
unsigned getBuiltinCallee() const
getBuiltinCallee - If this is a call to a builtin, return the builtin ID of the callee.
static stable_iterator stable_end()
Create a stable reference to the bottom of the EH stack.
iterator begin() const
Returns an iterator pointing to the innermost EH scope.
Address getNormalCleanupDestSlot()
llvm::BasicBlock * getTerminateFunclet()
getTerminateLandingPad - Return a cleanup funclet that just calls terminate.
static const EHPersonality XL_CPlusPlus
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
void EmitStopPoint(const Stmt *S)
EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.
Address CreateMemTemp(QualType T, const Twine &Name="tmp", Address *Alloca=nullptr)
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen and cas...
This represents one expression.
CompoundStmt * getBlock() const
void exit(CodeGenFunction &CGF)
void EmitBranchThroughCleanup(JumpDest Dest)
EmitBranchThroughCleanup - Emit a branch from the current insert block through the normal cleanup han...
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
llvm::Value * getFilter(unsigned i) const
llvm::Function * getIntrinsic(unsigned IID, ArrayRef< llvm::Type * > Tys=None)
llvm::PointerType * VoidPtrPtrTy
SourceLocation getLocation() const
CallArgList - Type for representing both the value and type of arguments in a call.
virtual llvm::Constant * GetEHType(QualType T)=0
Get the type constant to catch for the given ObjC pointer type.
const CGFunctionInfo & arrangeBuiltinFunctionCall(QualType resultType, const CallArgList &args)
A reference to a declared variable, function, enum, etc.
Represents a function declaration or definition.
void popTerminate()
Pops a terminate handler off the stack.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
llvm::AssertingVH< llvm::Instruction > AllocaInsertPt
AllocaInsertPoint - This is an instruction in the entry block before which we prefer to insert alloca...
iterator find(stable_iterator save) const
Turn a stable reference to a scope depth into a unstable pointer to the EH stack.
static const EHPersonality GNU_CPlusPlus_SJLJ
llvm::LLVMContext & getLLVMContext()
A saved depth on the scope stack.
const LangOptions & getLangOpts() const
void EmitSEHLeaveStmt(const SEHLeaveStmt &S)
static const EHPersonality GNU_ObjC_SJLJ
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
llvm::BasicBlock * EmitLandingPad()
Emits a landing pad for the current EH stack.
void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
@ Other
Other implicit parameter.
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
Represents a __leave statement.
static const EHPersonality GNU_ObjC
unsigned getNumExceptions() const
Return the number of types in the exception specification.
Address ReturnValue
ReturnValue - The temporary alloca to hold the return value.
bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType)
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.