summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-06-17 21:29:06 +0000
committerBill Wendling <isanbard@gmail.com>2011-06-17 21:29:06 +0000
commit5ba89837d7cba1719ab069ac558c8a06aa26b9a6 (patch)
tree2755a73ab44f427f29dcea932c7f96791f1670c7 /lib
parent2fb86a8fe6c53ea55511fa7e42c561138e55f8c4 (diff)
downloadllvm-5ba89837d7cba1719ab069ac558c8a06aa26b9a6.tar.gz
llvm-5ba89837d7cba1719ab069ac558c8a06aa26b9a6.tar.bz2
llvm-5ba89837d7cba1719ab069ac558c8a06aa26b9a6.tar.xz
SjLj exception handling LSDA decoding support wasn't represented correctly. Use
the correct values, etc. In particular, the exception handling type is SjLj, not ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCAsmStreamer.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index f67aac3fca..d1ea3c9044 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -1482,7 +1482,7 @@ void MCLSDADecoderAsmStreamer::EmitEHTableDescription() {
CMT << "@CallSite Encoding: " << DecodeDWARFEncoding(LSDAEncoding[4]) << "\n";
CMT << "@Action Table Size: " << LSDAEncoding[5] << " bytes\n\n";
- bool isSjLjEH = (MAI.getExceptionHandlingType() == ExceptionHandling::ARM);
+ bool isSjLjEH = (MAI.getExceptionHandlingType() == ExceptionHandling::SjLj);
int64_t CallSiteTableSize = LSDAEncoding[5];
unsigned CallSiteEntrySize;
@@ -1493,14 +1493,13 @@ void MCLSDADecoderAsmStreamer::EmitEHTableDescription() {
1; // TType index.
else
CallSiteEntrySize = 1 + // Call index.
- 1 + // Landing pad.
1; // TType index.
unsigned NumEntries = CallSiteTableSize / CallSiteEntrySize;
assert(CallSiteTableSize % CallSiteEntrySize == 0 &&
"The action table size is not a multiple of what it should be!");
unsigned TTypeIdx = 5 + // Action table size index.
- (isSjLjEH ? 3 : 4) * NumEntries + // Action table entries.
+ (isSjLjEH ? 2 : 4) * NumEntries + // Action table entries.
1; // Just because.
// Emit the action table.
@@ -1518,20 +1517,20 @@ void MCLSDADecoderAsmStreamer::EmitEHTableDescription() {
// The end of the throwing region.
Idx = LSDAEncoding[I++];
OS << *cast<MCBinaryExpr>(Assignments[Idx - 1])->getLHS();
- } else {
- CMT << " A throw from call " << *Assignments[Idx - 1];
- }
- // The landing pad.
- Idx = LSDAEncoding[I++];
- if (Idx) {
- OS << " jumps to "
- << *cast<MCBinaryExpr>(Assignments[Idx - 1])->getLHS()
- << " on an exception.\n";
+ // The landing pad.
+ Idx = LSDAEncoding[I++];
+ if (Idx) {
+ OS << " jumps to "
+ << *cast<MCBinaryExpr>(Assignments[Idx - 1])->getLHS()
+ << " on an exception.\n";
+ } else {
+ OS << " does not have a landing pad.\n";
+ ++I;
+ continue;
+ }
} else {
- OS << " does not have a landing pad.\n";
- ++I;
- continue;
+ CMT << " A throw from call " << Idx << "\n";
}
// The index into the action table.
@@ -1606,11 +1605,10 @@ MCStreamer *llvm::createAsmStreamer(MCContext &Context,
bool useCFI, MCInstPrinter *IP,
MCCodeEmitter *CE, TargetAsmBackend *TAB,
bool ShowInst) {
-#if 0
if (isVerboseAsm)
return new MCLSDADecoderAsmStreamer(Context, OS, isVerboseAsm, useLoc,
useCFI, IP, CE, TAB, ShowInst);
-#endif
+
return new MCAsmStreamer(Context, OS, isVerboseAsm, useLoc, useCFI,
IP, CE, TAB, ShowInst);
}