diff options
author | Heejin Ahn <aheejin@gmail.com> | 2018-06-19 00:26:39 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2018-06-19 00:26:39 +0000 |
commit | 33c3fce592cda760250f65fe5713fe3b01935f59 (patch) | |
tree | 638caebdc821792becda559573c101a858010639 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | de735c977d7a7d684cb5aecd4a1ca2ed3998f8b2 (diff) | |
download | bcm5719-llvm-33c3fce592cda760250f65fe5713fe3b01935f59.tar.gz bcm5719-llvm-33c3fce592cda760250f65fe5713fe3b01935f59.zip |
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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"); |