From 33c3fce592cda760250f65fe5713fe3b01935f59 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 19 Jun 2018 00:26:39 +0000 Subject: [WebAssembly] Add WasmEHFuncInfo for unwind destination information Summary: Add WasmEHFuncInfo and routines to calculate and fill in this struct to keep track of unwind destination information. This will be used in other EH related passes. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, chrib, llvm-commits Differential Revision: https://reviews.llvm.org/D48263 llvm-svn: 335005 --- llvm/lib/CodeGen/MachineFunction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index e47aeb64910..a376614ade9 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -37,6 +37,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/WasmEHFuncInfo.h" #include "llvm/CodeGen/WinEHFuncInfo.h" #include "llvm/Config/llvm-config.h" #include "llvm/IR/Attributes.h" @@ -175,6 +176,11 @@ void MachineFunction::init() { WinEHInfo = new (Allocator) WinEHFuncInfo(); } + if (isScopedEHPersonality(classifyEHPersonality( + F.hasPersonalityFn() ? F.getPersonalityFn() : nullptr))) { + WasmEHInfo = new (Allocator) WasmEHFuncInfo(); + } + assert(Target.isCompatibleDataLayout(getDataLayout()) && "Can't create a MachineFunction using a Module with a " "Target-incompatible DataLayout attached\n"); -- cgit v1.2.3