summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineModuleInfo.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-08-27 15:47:50 +0000
committerDuncan Sands <baldrick@free.fr>2007-08-27 15:47:50 +0000
commit6590b0457c5e28a7336ae31de194953d8127217a (patch)
treeabbc2f1ee9dd21367b0e5befed02ec2616ae4d9a /include/llvm/CodeGen/MachineModuleInfo.h
parent81975f6dfd9d306d0ea7ce3ef22561c949de9af9 (diff)
downloadllvm-6590b0457c5e28a7336ae31de194953d8127217a.tar.gz
llvm-6590b0457c5e28a7336ae31de194953d8127217a.tar.bz2
llvm-6590b0457c5e28a7336ae31de194953d8127217a.tar.xz
There is an impedance matching problem between LLVM and
gcc exception handling: if an exception unwinds through an invoke, then execution must branch to the invoke's unwind target. We previously tried to enforce this by appending a cleanup action to every selector, however this does not always work correctly due to an optimization in the C++ unwinding runtime: if only cleanups would be run while unwinding an exception, then the program just terminates without actually executing the cleanups, as invoke semantics would require. I was hoping this wouldn't be a problem, but in fact it turns out to be the cause of all the remaining failures in the LLVM testsuite (these also fail with -enable-correct-eh-support, so turning on -enable-eh didn't make things worse!). Instead we need to append a full-blown catch-all to the end of each selector. The correct way of doing this depends on the personality function, i.e. it is language dependent, so can only be done by gcc. Thus this patch which generalizes the eh.selector intrinsic so that it can handle all possible kinds of action table entries (before it didn't accomodate cleanups): now 0 indicates a cleanup, and filters have to be specified using the number of type infos plus one rather than the number of type infos. Related gcc patches will cause Ada to pass a cleanup (0) to force the selector to always fire, while C++ will use a C++ catch-all (null). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index 778b75c899..bb79c19ff7 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -966,7 +966,6 @@ struct LandingPadInfo {
: LandingPadBlock(MBB)
, LandingPadLabel(0)
, Personality(NULL)
- , TypeIds(1, 0) // Always have cleanups
{}
};
@@ -1239,6 +1238,10 @@ public:
void addFilterTypeInfo(MachineBasicBlock *LandingPad,
std::vector<GlobalVariable *> &TyInfo);
+ /// addCleanup - Add a cleanup action for a landing pad.
+ ///
+ void addCleanup(MachineBasicBlock *LandingPad);
+
/// getTypeIDFor - Return the type id for the specified typeinfo. This is
/// function wide.
unsigned getTypeIDFor(GlobalVariable *TI);