Rework getPersonalityIndex slightly - 0 is now a valid and not-NULL
authorEric Christopher <echristo@apple.com>
Wed, 26 Aug 2009 21:44:57 +0000 (21:44 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 26 Aug 2009 21:44:57 +0000 (21:44 +0000)
personality function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80153 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineModuleInfo.cpp

index 2bd13c0f97e12bd9a7867e71d0607a80f36f26b4..a673d177fa1e1ef8643c45f3ae2d638dfab46227 100644 (file)
@@ -277,7 +277,7 @@ Function *MachineModuleInfo::getPersonality() const {
 }
 
 /// 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 {
   const Function* Personality = NULL;
 
@@ -293,8 +293,8 @@ unsigned MachineModuleInfo::getPersonalityIndex() const {
       return i;
   }
 
-  // This should never happen
-  llvm_unreachable("Personality function should be set!");
+  // This will happen if the current personality function is
+  // in the zero index.
   return 0;
 }