summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.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/Target/ARM/AsmPrinter/ARMAsmPrinter.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/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index d782cdedc15..49e2490cf3c 100644
--- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -44,6 +44,7 @@
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/FormattedStream.h"
#include <cctype>
+#include <sstream>
using namespace llvm;
STATISTIC(EmittedInsts, "Number of machine instrs printed");
@@ -159,8 +160,13 @@ namespace {
ARMConstantPoolValue *ACPV = static_cast<ARMConstantPoolValue*>(MCPV);
GlobalValue *GV = ACPV->getGV();
std::string Name;
-
- if (GV) {
+
+ if (ACPV->isLSDA()) {
+ std::stringstream out;
+ out << getFunctionNumber();
+ Name = Mang->makeNameProper(std::string("LSDA_") + out.str(),
+ Mangler::Private);
+ } else if (GV) {
bool isIndirect = Subtarget->isTargetDarwin() &&
Subtarget->GVIsIndirectSymbol(GV,
TM.getRelocationModel() == Reloc::Static);
@@ -175,9 +181,7 @@ namespace {
else
GVNonLazyPtrs[SymName] = Name;
}
- } else if (!strncmp(ACPV->getSymbol(), "L_lsda_", 7))
- Name = ACPV->getSymbol();
- else
+ } else
Name = Mang->makeNameProper(ACPV->getSymbol());
O << Name;
OpenPOWER on IntegriCloud