Skip to content
This repository was archived by the owner on Dec 20, 2019. It is now read-only.

Commit fc854b8

Browse files
committed
[llvm] Emit some extra labels in the mono EH writer which are needed by ARMAsmPrinter on 32 bit ios.
1 parent b606857 commit fc854b8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ bool AsmPrinter::doInitialization(Module &M) {
364364
Handlers.push_back(HandlerInfo(ES, EHTimerName, EHTimerDescription,
365365
DWARFGroupName, DWARFGroupDescription));
366366
if (EnableMonoEH)
367-
Handlers.push_back(HandlerInfo(new MonoException(this), EHTimerName, EHTimerDescription, DWARFGroupName, DWARFGroupDescription));
367+
Handlers.push_back(HandlerInfo(new MonoException(this, DisableGNUEH), EHTimerName, EHTimerDescription, DWARFGroupName, DWARFGroupDescription));
368368
return false;
369369
}
370370

lib/CodeGen/AsmPrinter/MonoException.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,11 @@ emitCFIInstructions(MCStreamer &streamer,
240240
}
241241
}
242242

243-
MonoException::MonoException(AsmPrinter *A)
243+
MonoException::MonoException(AsmPrinter *A, bool disableGNUEH)
244244
: EHStreamer(A)
245245
{
246246
RI = nullptr;
247+
DisableGNUEH = disableGNUEH;
247248
}
248249

249250
MonoException::~MonoException()
@@ -404,6 +405,10 @@ MonoException::endFunction(const MachineFunction *MF)
404405
info.Instructions = MF->getFrameInstructions();
405406
assert (info.Instructions.size () == info.EHLabels.size());
406407

408+
if (DisableGNUEH)
409+
/* ARMAsmPrinter generates references to this */
410+
Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym());
411+
407412
PrepareMonoLSDA(&info);
408413

409414
Frames.push_back(info);

lib/CodeGen/AsmPrinter/MonoException.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TargetRegisterInfo;
1919

2020
class MonoException : public EHStreamer {
2121
public:
22-
MonoException(AsmPrinter *A);
22+
MonoException(AsmPrinter *A, bool disableGNUEH);
2323
virtual ~MonoException();
2424

2525
virtual void endModule();
@@ -72,6 +72,7 @@ class MonoException : public EHStreamer {
7272
std::vector<EHInfo> Frames;
7373
StringMap<int> FuncIndexes;
7474
const TargetRegisterInfo *RI;
75+
bool DisableGNUEH;
7576
};
7677
} // End of namespace llvm
7778

0 commit comments

Comments
 (0)