diff options
author | Kevin Enderby <enderby@apple.com> | 2010-07-08 17:22:42 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2010-07-08 17:22:42 +0000 |
commit | f59cac5ed36360b4c462781051f996b3499d7e0f (patch) | |
tree | ff513719695e99989d6b566301d9376cbea720d1 /lib/MC | |
parent | da995609e6e963eaa77346d43b0a33b81e53a785 (diff) | |
download | external_llvm-f59cac5ed36360b4c462781051f996b3499d7e0f.zip external_llvm-f59cac5ed36360b4c462781051f996b3499d7e0f.tar.gz external_llvm-f59cac5ed36360b4c462781051f996b3499d7e0f.tar.bz2 |
Added the darwin .weak_def_can_be_hidden directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCAsmInfo.cpp | 1 | ||||
-rw-r--r-- | lib/MC/MCAsmInfoDarwin.cpp | 1 | ||||
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 1 | ||||
-rw-r--r-- | lib/MC/MCMachOStreamer.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 2 |
5 files changed, 9 insertions, 0 deletions
diff --git a/lib/MC/MCAsmInfo.cpp b/lib/MC/MCAsmInfo.cpp index a275be2..b726b3d 100644 --- a/lib/MC/MCAsmInfo.cpp +++ b/lib/MC/MCAsmInfo.cpp @@ -59,6 +59,7 @@ MCAsmInfo::MCAsmInfo() { HasNoDeadStrip = false; WeakRefDirective = 0; WeakDefDirective = 0; + WeakDefAutoPrivateDirective = 0; LinkOnceDirective = 0; HiddenVisibilityAttr = MCSA_Hidden; ProtectedVisibilityAttr = MCSA_Protected; diff --git a/lib/MC/MCAsmInfoDarwin.cpp b/lib/MC/MCAsmInfoDarwin.cpp index 0bd3b2d..4f5075f 100644 --- a/lib/MC/MCAsmInfoDarwin.cpp +++ b/lib/MC/MCAsmInfoDarwin.cpp @@ -33,6 +33,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() { // Directives: WeakDefDirective = "\t.weak_definition "; WeakRefDirective = "\t.weak_reference "; + WeakDefAutoPrivateDirective = "\t.weak_def_can_be_hidden "; ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. HasMachoZeroFillDirective = true; // Uses .zerofill HasMachoTBSSDirective = true; // Uses .tbss diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 530c89b..e272b60 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -288,6 +288,7 @@ void MCAsmStreamer::EmitSymbolAttribute(MCSymbol *Symbol, case MCSA_WeakDefinition: OS << "\t.weak_definition\t"; break; // .weak_reference case MCSA_WeakReference: OS << MAI.getWeakRefDirective(); break; + case MCSA_WeakDefAutoPrivate: OS << "\t.weak_def_can_be_hidden\t"; break; } OS << *Symbol; diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index 3febda0..44bc267 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/lib/MC/MCMachOStreamer.cpp @@ -273,6 +273,10 @@ void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol, // it has to be in a coalesced section, but this isn't enforced. SD.setFlags(SD.getFlags() | SF_WeakDefinition); break; + + case MCSA_WeakDefAutoPrivate: + SD.setFlags(SD.getFlags() | SF_WeakDefinition | SF_WeakReference); + break; } } diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 94b545a..181b69f 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -755,6 +755,8 @@ bool AsmParser::ParseStatement() { return ParseDirectiveSymbolAttribute(MCSA_WeakDefinition); if (IDVal == ".weak_reference") return ParseDirectiveSymbolAttribute(MCSA_WeakReference); + if (IDVal == ".weak_def_can_be_hidden") + return ParseDirectiveSymbolAttribute(MCSA_WeakDefAutoPrivate); if (IDVal == ".comm") return ParseDirectiveComm(/*IsLocal=*/false); |