diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-04-16 08:46:10 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-04-16 08:46:10 +0000 |
commit | 47639fc5be0b8f4873d076a9ed24b9a3c0682b15 (patch) | |
tree | 0e7b9e63cfb4a26799db1de4dbf68d83dc7098c9 /lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp | |
parent | 8b5d9c89146c012f8e532c03720814b84b4ee359 (diff) | |
download | external_llvm-47639fc5be0b8f4873d076a9ed24b9a3c0682b15.zip external_llvm-47639fc5be0b8f4873d076a9ed24b9a3c0682b15.tar.gz external_llvm-47639fc5be0b8f4873d076a9ed24b9a3c0682b15.tar.bz2 |
The JIT calls TidyLandingPads to tidy up the landing pads. However, because the
JIT doesn't use the MC back-end asm printer to emit labels that it uses, the
section for the MCSymbol is never set. And thus the MCSymbol for the EH label
isn't marked as "defined". Because of that, TidyLandingPads removes the needed
landing pads from the JIT output. This breaks EH for every JIT program.
This is a work-around for this limitation. We pass in the label locations
map. If the label has a non-zero value, then it was "emitted" by the JIT and
TidyLandingPads shouldn't remove that label.
A nicer solution would be to mark the MCSymbol as "used" by the JIT and not rely
upon the section being set to determine if it's defined or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp index 5819f25..281ec73 100644 --- a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp @@ -199,7 +199,7 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF, assert(MMI && "MachineModuleInfo not registered!"); // Map all labels and get rid of any dead landing pads. - MMI->TidyLandingPads(); + MMI->TidyLandingPads(JCE->getLabelLocations()); const std::vector<const GlobalVariable *> &TypeInfos = MMI->getTypeInfos(); const std::vector<unsigned> &FilterIds = MMI->getFilterIds(); @@ -780,7 +780,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { unsigned FinalSize = 0; // Map all labels and get rid of any dead landing pads. - MMI->TidyLandingPads(); + MMI->TidyLandingPads(JCE->getLabelLocations()); const std::vector<const GlobalVariable *> &TypeInfos = MMI->getTypeInfos(); const std::vector<unsigned> &FilterIds = MMI->getFilterIds(); |