mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-05 03:10:41 +00:00
Mark the EH symbol global or weak if the corresponding function is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb69732d56
commit
8bca4106df
@ -184,6 +184,9 @@ namespace llvm {
|
||||
/// used in an assignment.
|
||||
virtual void EmitLabel(MCSymbol *Symbol);
|
||||
|
||||
virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
|
||||
MCSymbol *EHSymbol);
|
||||
|
||||
/// EmitAssemblerFlag - Note in the output the specified @p Flag
|
||||
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0;
|
||||
|
||||
|
@ -726,6 +726,7 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
|
||||
if (!asmInfo.isFunctionEHFrameSymbolPrivate()) {
|
||||
Twine EHName = frame.Function->getName() + Twine(".eh");
|
||||
MCSymbol *EHSym = context.GetOrCreateSymbol(EHName);
|
||||
streamer.EmitEHSymAttributes(frame.Function, EHSym);
|
||||
streamer.EmitLabel(EHSym);
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,8 @@ public:
|
||||
|
||||
virtual void InitSections();
|
||||
virtual void EmitLabel(MCSymbol *Symbol);
|
||||
virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
|
||||
MCSymbol *EHSymbol);
|
||||
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
|
||||
virtual void EmitThumbFunc(MCSymbol *Func);
|
||||
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
|
||||
@ -101,6 +103,16 @@ void MCMachOStreamer::InitSections() {
|
||||
|
||||
}
|
||||
|
||||
void MCMachOStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
|
||||
MCSymbol *EHSymbol) {
|
||||
MCSymbolData &SD =
|
||||
getAssembler().getOrCreateSymbolData(*Symbol);
|
||||
if (SD.isExternal())
|
||||
EmitSymbolAttribute(EHSymbol, MCSA_Global);
|
||||
if (SD.getFlags() & SF_WeakDefinition)
|
||||
EmitSymbolAttribute(EHSymbol, MCSA_WeakDefinition);
|
||||
}
|
||||
|
||||
void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
|
||||
assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
|
||||
|
||||
|
@ -154,6 +154,10 @@ void MCStreamer::EnsureValidFrame() {
|
||||
report_fatal_error("No open frame");
|
||||
}
|
||||
|
||||
void MCStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
|
||||
MCSymbol *EHSymbol) {
|
||||
}
|
||||
|
||||
void MCStreamer::EmitLabel(MCSymbol *Symbol) {
|
||||
assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
|
||||
assert(getCurrentSection() && "Cannot emit before setting section!");
|
||||
|
Loading…
Reference in New Issue
Block a user