Make EH work with unnamed functions. Reenable running

StripSymbols when EH is on.

llvm-svn: 49110
This commit is contained in:
Dale Johannesen 2008-04-02 20:10:52 +00:00
parent 39d8b26322
commit 491557712a
2 changed files with 5 additions and 6 deletions

View File

@ -198,8 +198,10 @@ bool AsmPrinter::doFinalization(Module &M) {
std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
assert(MF && "No machine function?");
return Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
TAI->getGlobalPrefix());
std::string Name = MF->getFunction()->getName();
if (Name.empty())
Name = Mang->getValueName(MF->getFunction());
return Mang->makeNameProper(Name + ".eh", TAI->getGlobalPrefix());
}
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {

View File

@ -303,10 +303,7 @@ LTO::optimize(Module *M, std::ostream &Out,
// If the -s command line option was specified, strip the symbols out of the
// resulting program to make it smaller. -s is a GLD option that we are
// supporting.
if(!ExceptionHandling)
// FIXME : This causes multiple nameless _.eh symbols on
// darwin when EH is ON.
Passes.add(createStripSymbolsPass());
Passes.add(createStripSymbolsPass());
// Propagate constants at call sites into the functions they call.
Passes.add(createIPConstantPropagationPass());