Rework getPersonalityIndex slightly - 0 is now a valid and not-NULL

personality function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80153 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2009-08-26 21:44:57 +00:00
parent a626e16b38
commit 5e365e23f1

View File

@ -277,7 +277,7 @@ Function *MachineModuleInfo::getPersonality() const {
} }
/// getPersonalityIndex - Return unique index for current personality /// getPersonalityIndex - Return unique index for current personality
/// function. NULL personality function should always get zero index. /// function. NULL/first personality function should always get zero index.
unsigned MachineModuleInfo::getPersonalityIndex() const { unsigned MachineModuleInfo::getPersonalityIndex() const {
const Function* Personality = NULL; const Function* Personality = NULL;
@ -293,8 +293,8 @@ unsigned MachineModuleInfo::getPersonalityIndex() const {
return i; return i;
} }
// This should never happen // This will happen if the current personality function is
llvm_unreachable("Personality function should be set!"); // in the zero index.
return 0; return 0;
} }