Skip to content

Commit 2d6c8c3

Browse files
committed
Merge 80146 from mainline.
If we're emitting additional CIEs due to personality functions don't emit the default one. Explicitly check for the NULL CIE later. llvm-svn: 81702
1 parent a634991 commit 2d6c8c3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
202202

203203
// If there is a personality and landing pads then point to the language
204204
// specific data area in the exception table.
205-
if (EHFrameInfo.PersonalityIndex) {
205+
if (MMI->getPersonalities()[0] != NULL) {
206206
bool is4Byte = TD->getPointerSize() == sizeof(int32_t);
207207

208208
Asm->EmitULEB128Bytes(is4Byte ? 4 : 8);

llvm/lib/CodeGen/MachineModuleInfo.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ MachineModuleInfo::MachineModuleInfo()
4545
, CallsUnwindInit(0)
4646
, DbgInfoAvailable(false)
4747
{
48-
// Always emit "no personality" info
48+
// Always emit some info, by default "no personality" info.
4949
Personalities.push_back(NULL);
5050
}
5151
MachineModuleInfo::~MachineModuleInfo() {
@@ -149,7 +149,12 @@ void MachineModuleInfo::addPersonality(MachineBasicBlock *LandingPad,
149149
if (Personalities[i] == Personality)
150150
return;
151151

152-
Personalities.push_back(Personality);
152+
// If this is the first personality we're adding go
153+
// ahead and add it at the beginning.
154+
if (Personalities[0] == NULL)
155+
Personalities[0] = Personality;
156+
else
157+
Personalities.push_back(Personality);
153158
}
154159

155160
/// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.

0 commit comments

Comments
 (0)