Use MMI->getPersonality() instead of MMI->getPersonalities()[MMI->getPersonalityIndex()]

Also nuke the comment about supporting multiple personalities in a
single function, aka PR1414. That's just crazy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner 2015-01-14 22:47:54 +00:00
parent 37ac8d3622
commit 4ac8ae7ea1
4 changed files with 4 additions and 7 deletions

View File

@ -88,8 +88,7 @@ void ARMException::endFunction(const MachineFunction *) {
Asm->getFunctionNumber()));
if (!MMI->getLandingPads().empty()) {
// Emit references to personality.
if (const Function * Personality =
MMI->getPersonalities()[MMI->getPersonalityIndex()]) {
if (const Function *Personality = MMI->getPersonality()) {
MCSymbol *PerSym = Asm->getSymbol(Personality);
Asm->OutStreamer.EmitSymbolAttribute(PerSym, MCSA_Global);
ATS.emitPersonality(PerSym);

View File

@ -90,7 +90,7 @@ void DwarfCFIException::beginFunction(const MachineFunction *MF) {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
unsigned PerEncoding = TLOF.getPersonalityEncoding();
const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
const Function *Per = MMI->getPersonality();
shouldEmitPersonality = hasLandingPads &&
PerEncoding != dwarf::DW_EH_PE_omit && Per;

View File

@ -60,7 +60,7 @@ void Win64Exception::beginFunction(const MachineFunction *MF) {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
unsigned PerEncoding = TLOF.getPersonalityEncoding();
const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
const Function *Per = MF->getMMI().getPersonality();
shouldEmitPersonality = hasLandingPads &&
PerEncoding != dwarf::DW_EH_PE_omit && Per;
@ -105,7 +105,7 @@ void Win64Exception::endFunction(const MachineFunction *) {
// Emit the tables appropriate to the personality function in use. If we
// don't recognize the personality, assume it uses an Itanium-style LSDA.
const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
const Function *Per = MMI->getPersonality();
if (Per->getName() == "__C_specific_handler")
emitCSpecificHandlerTable();
else

View File

@ -554,8 +554,6 @@ try_next:;
/// getPersonality - Return the personality function for the current function.
const Function *MachineModuleInfo::getPersonality() const {
// FIXME: Until PR1414 will be fixed, we're using 1 personality function per
// function
return !LandingPads.empty() ? LandingPads[0].Personality : nullptr;
}