summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-19 07:36:31 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-19 07:36:31 +0000
commit030bce7b83af19576c00f4e66178b177cb971b16 (patch)
tree1f7d49e37597618b4074a68fa260d1dc889c9efe /llvm/lib/CodeGen/MachineModuleInfo.cpp
parent9b834469e08312ef655154eb5d0fafc2ecf4b5af (diff)
downloadbcm5719-llvm-030bce7b83af19576c00f4e66178b177cb971b16.tar.gz
bcm5719-llvm-030bce7b83af19576c00f4e66178b177cb971b16.zip
The C++ exception handling personality function wants
to know about calls that cannot throw ('nounwind'): if such a call does throw for some reason then the personality will terminate the program. The distinction between an ordinary call and a nounwind call is that an ordinary call gets an entry in the exception table but a nounwind call does not. This patch sets up the exception table appropriately. One oddity is that I've chosen to bracket nounwind calls with labels (like invokes) - the other choice would have been to bracket ordinary calls with labels. While bracketing ordinary calls is more natural (because bracketing by labels would then correspond exactly to getting an entry in the exception table), I didn't do it because introducing labels impedes some optimizations and I'm guessing that ordinary calls occur more often than nounwind calls. This fixes the gcc filter2 eh test, at least at -O0 (the inliner needs some tweaking at higher optimization levels). llvm-svn: 45197
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index 14253f41117..59c335e7fb0 100644
--- a/llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -1747,7 +1747,7 @@ void MachineModuleInfo::TidyLandingPads() {
LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
// Special case: we *should* emit LPs with null LP MBB. This indicates
- // "rethrow" case.
+ // "nounwind" case.
if (!LandingPad.LandingPadLabel && LandingPad.LandingPadBlock) {
LandingPads.erase(LandingPads.begin() + i);
continue;
@@ -1757,7 +1757,6 @@ void MachineModuleInfo::TidyLandingPads() {
unsigned BeginLabel = MappedLabel(LandingPad.BeginLabels[j]);
unsigned EndLabel = MappedLabel(LandingPad.EndLabels[j]);
-
if (!BeginLabel || !EndLabel) {
LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
OpenPOWER on IntegriCloud