================
@@ -635,14 +635,30 @@ void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S)
{
ExitCXXTryStmt(S);
}
+struct TerminateTryScope final : EHScopeStack::Cleanup {
+ llvm::BasicBlock *InvokeDest;
+
+ TerminateTryScope(llvm::BasicBlock *BB) : InvokeDest(BB) {}
+
+ void Emit(CodeGenFunction &CGF, Flags flags) override {
+ CGF.EmitSehTryScopeEnd(InvokeDest);
+ }
+};
+
+struct HandlerInfo {
+ CatchTypeInfo TypeInfo;
+ bool RequiresSehScope;
+};
+
void CodeGenFunction::EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock) {
unsigned NumHandlers = S.getNumHandlers();
- EHCatchScope *CatchScope = EHStack.pushCatch(NumHandlers);
+ unsigned NumHandlerInfos = NumHandlers > 0 ? NumHandlers - 1 : 0;
+ llvm::BasicBlock *DispatchBlock = nullptr;
+ llvm::SmallVector<HandlerInfo> HandlerInfos;
+ HandlerInfos.reserve(NumHandlerInfos);
----------------
efriedma-quic wrote:
It's not worth the extra code here to try to reserve the exact amount in the
array.
https://github.com/llvm/llvm-project/pull/167176
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits