-
-/// 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 : NULL;
-}
-
-/// getPersonalityIndex - Return unique index for current personality
-/// function. NULL/first personality function should always get zero index.
-unsigned MachineModuleInfo::getPersonalityIndex() const {
- const Function* Personality = NULL;
-
- // Scan landing pads. If there is at least one non-NULL personality - use it.
- for (unsigned i = 0; i != LandingPads.size(); ++i)
- if (LandingPads[i].Personality) {
- Personality = LandingPads[i].Personality;
- break;
- }
-
- for (unsigned i = 0; i < Personalities.size(); ++i) {
- if (Personalities[i] == Personality)
- return i;
- }
-
- // This will happen if the current personality function is
- // in the zero index.
- return 0;
-}