#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "ConstantEmitter.h"
#include "TargetInfo.h"
#include "clang/AST/Mangle.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtObjC.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/TargetBuiltins.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsWebAssembly.h"
#include "llvm/Support/SaveAndRestore.h"
usingnamespaceclang;
usingnamespaceCodeGen;
static llvm::FunctionCallee getFreeExceptionFn(CodeGenModule &CGM) { … }
static llvm::FunctionCallee getSehTryBeginFn(CodeGenModule &CGM) { … }
static llvm::FunctionCallee getSehTryEndFn(CodeGenModule &CGM) { … }
static llvm::FunctionCallee getUnexpectedFn(CodeGenModule &CGM) { … }
llvm::FunctionCallee CodeGenModule::getTerminateFn() { … }
static llvm::FunctionCallee getCatchallRethrowFn(CodeGenModule &CGM,
StringRef Name) { … }
const EHPersonality EHPersonality::GNU_C = …;
const EHPersonality
EHPersonality::GNU_C_SJLJ = …;
const EHPersonality
EHPersonality::GNU_C_SEH = …;
const EHPersonality
EHPersonality::NeXT_ObjC = …;
const EHPersonality
EHPersonality::GNU_CPlusPlus = …;
const EHPersonality
EHPersonality::GNU_CPlusPlus_SJLJ = …;
const EHPersonality
EHPersonality::GNU_CPlusPlus_SEH = …;
const EHPersonality
EHPersonality::GNU_ObjC = …;
const EHPersonality
EHPersonality::GNU_ObjC_SJLJ = …;
const EHPersonality
EHPersonality::GNU_ObjC_SEH = …;
const EHPersonality
EHPersonality::GNU_ObjCXX = …;
const EHPersonality
EHPersonality::GNUstep_ObjC = …;
const EHPersonality
EHPersonality::MSVC_except_handler = …;
const EHPersonality
EHPersonality::MSVC_C_specific_handler = …;
const EHPersonality
EHPersonality::MSVC_CxxFrameHandler3 = …;
const EHPersonality
EHPersonality::GNU_Wasm_CPlusPlus = …;
const EHPersonality EHPersonality::XL_CPlusPlus = …;
const EHPersonality EHPersonality::ZOS_CPlusPlus = …;
static const EHPersonality &getCPersonality(const TargetInfo &Target,
const LangOptions &L) { … }
static const EHPersonality &getObjCPersonality(const TargetInfo &Target,
const LangOptions &L) { … }
static const EHPersonality &getCXXPersonality(const TargetInfo &Target,
const LangOptions &L) { … }
static const EHPersonality &getObjCXXPersonality(const TargetInfo &Target,
const LangOptions &L) { … }
static const EHPersonality &getSEHPersonalityMSVC(const llvm::Triple &T) { … }
const EHPersonality &EHPersonality::get(CodeGenModule &CGM,
const FunctionDecl *FD) { … }
const EHPersonality &EHPersonality::get(CodeGenFunction &CGF) { … }
static llvm::FunctionCallee getPersonalityFn(CodeGenModule &CGM,
const EHPersonality &Personality) { … }
static llvm::Constant *getOpaquePersonalityFn(CodeGenModule &CGM,
const EHPersonality &Personality) { … }
static bool LandingPadHasOnlyCXXUses(llvm::LandingPadInst *LPI) { … }
static bool PersonalityHasOnlyCXXUses(llvm::Constant *Fn) { … }
void CodeGenModule::SimplifyPersonality() { … }
static llvm::Constant *getCatchAllValue(CodeGenFunction &CGF) { … }
namespace {
struct FreeException final : EHScopeStack::Cleanup { … };
}
void CodeGenFunction::EmitAnyExprToExn(const Expr *e, Address addr) { … }
Address CodeGenFunction::getExceptionSlot() { … }
Address CodeGenFunction::getEHSelectorSlot() { … }
llvm::Value *CodeGenFunction::getExceptionFromSlot() { … }
llvm::Value *CodeGenFunction::getSelectorFromSlot() { … }
void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E,
bool KeepInsertionPoint) { … }
void CodeGenFunction::EmitStartEHSpec(const Decl *D) { … }
static void emitFilterDispatchBlock(CodeGenFunction &CGF,
EHFilterScope &filterScope) { … }
void CodeGenFunction::EmitEndEHSpec(const Decl *D) { … }
void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) { … }
void CodeGenFunction::EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock) { … }
llvm::BasicBlock *
CodeGenFunction::getEHDispatchBlock(EHScopeStack::stable_iterator si) { … }
llvm::BasicBlock *
CodeGenFunction::getFuncletEHDispatchBlock(EHScopeStack::stable_iterator SI) { … }
static bool isNonEHScope(const EHScope &S) { … }
llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() { … }
llvm::BasicBlock *CodeGenFunction::EmitLandingPad() { … }
static void emitCatchPadBlock(CodeGenFunction &CGF, EHCatchScope &CatchScope) { … }
static void emitWasmCatchPadBlock(CodeGenFunction &CGF,
EHCatchScope &CatchScope) { … }
static void emitCatchDispatchBlock(CodeGenFunction &CGF,
EHCatchScope &catchScope) { … }
void CodeGenFunction::popCatchScope() { … }
void CodeGenFunction::ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock) { … }
namespace {
struct CallEndCatchForFinally final : EHScopeStack::Cleanup { … };
struct PerformFinally final : EHScopeStack::Cleanup { … };
}
void CodeGenFunction::FinallyInfo::enter(CodeGenFunction &CGF, const Stmt *body,
llvm::FunctionCallee beginCatchFn,
llvm::FunctionCallee endCatchFn,
llvm::FunctionCallee rethrowFn) { … }
void CodeGenFunction::FinallyInfo::exit(CodeGenFunction &CGF) { … }
llvm::BasicBlock *CodeGenFunction::getTerminateLandingPad() { … }
llvm::BasicBlock *CodeGenFunction::getTerminateHandler() { … }
llvm::BasicBlock *CodeGenFunction::getTerminateFunclet() { … }
llvm::BasicBlock *CodeGenFunction::getEHResumeBlock(bool isCleanup) { … }
void CodeGenFunction::EmitSEHTryStmt(const SEHTryStmt &S) { … }
void CodeGenFunction::VolatilizeTryBlocks(
llvm::BasicBlock *BB, llvm::SmallPtrSet<llvm::BasicBlock *, 10> &V) { … }
namespace {
struct PerformSEHFinally final : EHScopeStack::Cleanup { … };
}
namespace {
struct CaptureFinder : ConstStmtVisitor<CaptureFinder> { … };
}
Address CodeGenFunction::recoverAddrOfEscapedLocal(CodeGenFunction &ParentCGF,
Address ParentVar,
llvm::Value *ParentFP) { … }
void CodeGenFunction::EmitCapturedLocals(CodeGenFunction &ParentCGF,
const Stmt *OutlinedStmt,
bool IsFilter) { … }
void CodeGenFunction::startOutlinedSEHHelper(CodeGenFunction &ParentCGF,
bool IsFilter,
const Stmt *OutlinedStmt) { … }
llvm::Function *
CodeGenFunction::GenerateSEHFilterFunction(CodeGenFunction &ParentCGF,
const SEHExceptStmt &Except) { … }
llvm::Function *
CodeGenFunction::GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF,
const SEHFinallyStmt &Finally) { … }
void CodeGenFunction::EmitSEHExceptionCodeSave(CodeGenFunction &ParentCGF,
llvm::Value *ParentFP,
llvm::Value *EntryFP) { … }
llvm::Value *CodeGenFunction::EmitSEHExceptionInfo() { … }
llvm::Value *CodeGenFunction::EmitSEHExceptionCode() { … }
llvm::Value *CodeGenFunction::EmitSEHAbnormalTermination() { … }
void CodeGenFunction::pushSEHCleanup(CleanupKind Kind,
llvm::Function *FinallyFunc) { … }
void CodeGenFunction::EnterSEHTryStmt(const SEHTryStmt &S) { … }
void CodeGenFunction::ExitSEHTryStmt(const SEHTryStmt &S) { … }
void CodeGenFunction::EmitSEHLeaveStmt(const SEHLeaveStmt &S) { … }