Use MMI->getPersonality() instead of MMI->getPersonalities()[MMI->getPersonalityIndex()]
authorReid Kleckner <reid@kleckner.net>
Wed, 14 Jan 2015 22:47:54 +0000 (22:47 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 14 Jan 2015 22:47:54 +0000 (22:47 +0000)
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

lib/CodeGen/AsmPrinter/ARMException.cpp
lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
lib/CodeGen/AsmPrinter/Win64Exception.cpp
lib/CodeGen/MachineModuleInfo.cpp

index 66c6c633540733228c05f1a4ce2c6ad6b907f1d5..6fe75ad82d26b095bbd8dffb8fcd04cfaa12f729 100644 (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);
index 0dc52dae8f39750675f6c2339701e03dbd2fd108..0bbe1ab1e5cdfadcd0028c08bc7a84b318a31bf7 100644 (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;
index 84549ae95aefc2570cce95c2c71435f4f6513aa7..567e0651e34f941e9ced6f82d4bfd29f65547fc3 100644 (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
index 32d511285eb21243be54b42359396f8d76df0c54..b5a31925e6b252024fd7961baa3c56eb0286aa51 100644 (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;
 }