If we're emitting additional CIEs due to personality functions
authorEric Christopher <echristo@apple.com>
Wed, 26 Aug 2009 21:30:49 +0000 (21:30 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 26 Aug 2009 21:30:49 +0000 (21:30 +0000)
don't emit the default one. Explicitly check for the NULL
CIE later.

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

lib/CodeGen/AsmPrinter/DwarfException.cpp
lib/CodeGen/MachineModuleInfo.cpp

index cbd438bc4026e762ad8c2bd6dac92a851e6929ff..170ca241b6a388ff40177103a55b26d4367ba80f 100644 (file)
@@ -203,7 +203,7 @@ void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) {
 
     // If there is a personality and landing pads then point to the language
     // specific data area in the exception table.
-    if (EHFrameInfo.PersonalityIndex) {
+    if (MMI->getPersonalities()[0] != NULL) {
       Asm->EmitULEB128Bytes(4);
       Asm->EOL("Augmentation size");
 
index 5a2b7466463436927fc9c3b67a54a4b9a60233da..2bd13c0f97e12bd9a7867e71d0607a80f36f26b4 100644 (file)
@@ -44,7 +44,7 @@ MachineModuleInfo::MachineModuleInfo()
 , CallsUnwindInit(0)
 , DbgInfoAvailable(false)
 {
-  // Always emit "no personality" info
+  // Always emit some info, by default "no personality" info.
   Personalities.push_back(NULL);
 }
 MachineModuleInfo::~MachineModuleInfo() {
@@ -148,7 +148,12 @@ void MachineModuleInfo::addPersonality(MachineBasicBlock *LandingPad,
     if (Personalities[i] == Personality)
       return;
 
-  Personalities.push_back(Personality);
+  // If this is the first personality we're adding go
+  // ahead and add it at the beginning.
+  if (Personalities[0] == NULL)
+    Personalities[0] = Personality;
+  else
+    Personalities.push_back(Personality);
 }
 
 /// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.