Clean up LSDA name generation and use for SJLJ exception handling. This

makes an eggregious hack somewhat more palatable. Bringing the LSDA forward
and making it a GV available for reference would be even better, but is
beyond the scope of what I'm looking to solve at this point.

Objective C++ code could generate function names that broke the previous
scheme. This fixes that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80649 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2009-09-01 01:57:56 +00:00
parent f98d8fee3c
commit 3fb2b1ede3
9 changed files with 163 additions and 38 deletions

View File

@@ -25,9 +25,11 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/StringExtras.h"
#include <sstream>
using namespace llvm;
static TimerGroup &getDwarfTimerGroup() {
@@ -599,9 +601,12 @@ void DwarfException::EmitExceptionTable() {
EmitLabel("exception", SubprogramCount);
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
std::string SjLjName = "_lsda_";
SjLjName += MF->getFunction()->getName().str();
EmitLabel(SjLjName.c_str(), 0);
std::stringstream out;
out << Asm->getFunctionNumber();
std::string LSDAName =
Asm->Mang->makeNameProper(std::string("LSDA_") + out.str(),
Mangler::Private);
EmitLabel(LSDAName.c_str(), 0, false);
}
// Emit the header.