summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-02-26 00:43:54 +0000
committerBill Wendling <isanbard@gmail.com>2010-02-26 00:43:54 +0000
commit6394521a2b61edce9be689a36e1176102f200490 (patch)
tree0a574be4f6cc49d41fe2da0ddd7e7de9afda897b /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
parentd2d9da08f3d6069a98119dc76e0fac17e59eb305 (diff)
downloadbcm5719-llvm-6394521a2b61edce9be689a36e1176102f200490.tar.gz
bcm5719-llvm-6394521a2b61edce9be689a36e1176102f200490.zip
Add another (and hopefully the last) exception case, where once we recalculate
the alignment requirement, if it no longer makes the TType base offset overflow into extra bytes, then we need to pad to those bytes ourselves. llvm-svn: 97196
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index c3cbd62365a..99d235cf31b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -762,9 +762,16 @@ void DwarfException::EmitExceptionTable() {
SizeAlign -= TTypeBaseOverflow;
}
- if (!TTypeBaseOverflow || SizeAlign != 0)
- EmitULEB128(Offset, "@TType base offset");
- else
+ if (!TTypeBaseOverflow) {
+ EmitULEB128(TTypeBaseOffset + SizeAlign, "@TType base offset");
+ } else if (SizeAlign != 0) {
+ // If the new "offset + alignment" size doesn't require extra the same
+ // extra padding that the original one did, then we need to insert that
+ // padding ourselves.
+ EmitULEB128(TTypeBaseOffset + SizeAlign, "@TType base offset",
+ MCAsmInfo::getULEB128Size(TTypeBaseOffset + SizeAlign) !=
+ OffsetSize ? TTypeBaseOverflow : 0);
+ } else {
// If adding the extra padding to this offset causes it to buffer to the
// size of the padding needed, then we should perform the padding here and
// not at the call site table below. E.g. if we have this:
@@ -790,6 +797,7 @@ void DwarfException::EmitExceptionTable() {
//
// and not with padding on the "Call site table length" entry.
EmitULEB128(TTypeBaseOffset, "@TType base offset", TTypeBaseOverflow);
+ }
}
// SjLj Exception handling
OpenPOWER on IntegriCloud