summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-09-01 01:57:56 +0000
committerJim Grosbach <grosbach@apple.com>2009-09-01 01:57:56 +0000
commit20eac92d8850f09c153dbdf10135dc4f87de370f (patch)
treebab14f300fbcf64c6f148906b6ae7a8e26ca080a /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
parentb1bff47718121f53587b112db87d2580ffb89b97 (diff)
downloadbcm5719-llvm-20eac92d8850f09c153dbdf10135dc4f87de370f.tar.gz
bcm5719-llvm-20eac92d8850f09c153dbdf10135dc4f87de370f.zip
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. llvm-svn: 80649
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index f6feccdac8b..2fcee3e2850 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -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.
OpenPOWER on IntegriCloud