[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp MachineModuleInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Wed May 23 04:08:55 PDT 2007
Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.148 -> 1.149
MachineModuleInfo.cpp updated: 1.14 -> 1.15
---
Log message:
Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP info too. This fixes PR1439: http://llvm.org/PR1439
---
Diffs of the changes: (+13 -5)
DwarfWriter.cpp | 2 +-
MachineModuleInfo.cpp | 16 ++++++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.148 llvm/lib/CodeGen/DwarfWriter.cpp:1.149
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.148 Tue May 22 13:13:40 2007
+++ llvm/lib/CodeGen/DwarfWriter.cpp Wed May 23 06:08:30 2007
@@ -2852,7 +2852,7 @@
EmitLabel("eh_frame_begin", EHFrameInfo.Number);
- EmitSectionOffset("eh_frame_begin", "section_eh_frame",
+ EmitSectionOffset("eh_frame_begin", "eh_frame_common",
EHFrameInfo.Number, EHFrameInfo.PersonalityIndex,
true, true);
Asm->EOL("FDE CIE offset");
Index: llvm/lib/CodeGen/MachineModuleInfo.cpp
diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.14 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.15
--- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.14 Sun May 13 10:42:26 2007
+++ llvm/lib/CodeGen/MachineModuleInfo.cpp Wed May 23 06:08:31 2007
@@ -1723,7 +1723,9 @@
LandingPadInfo &LandingPad = LandingPads[i];
LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
- if (!LandingPad.LandingPadLabel) {
+ // Special case: we *should* emit LPs with null LP MBB. This indicates
+ // "rethrow" case.
+ if (!LandingPad.LandingPadLabel && LandingPad.LandingPadBlock) {
LandingPads.erase(LandingPads.begin() + i);
continue;
}
@@ -1768,9 +1770,15 @@
/// getPersonalityIndex - Return unique index for current personality
/// function. NULL personality function should always get zero index.
unsigned MachineModuleInfo::getPersonalityIndex() const {
- const Function* Personality = (!LandingPads.empty() ?
- LandingPads[0].Personality : NULL);
-
+ const Function* Personality = NULL;
+
+ // Scan landing pads. If there is at least one non-NULL personality - use it.
+ for (unsigned i = 0; i != LandingPads.size(); ++i)
+ if (LandingPads[i].Personality) {
+ Personality = LandingPads[i].Personality;
+ break;
+ }
+
for (unsigned i = 0; i < Personalities.size(); ++i) {
if (Personalities[i] == Personality)
return i;
More information about the llvm-commits
mailing list