MCStreamer: Add a few more "symbol attributes".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74077 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-06-24 16:36:52 +00:00
parent f5e75a1fa9
commit d814b21509
2 changed files with 25 additions and 4 deletions

View File

@ -23,9 +23,21 @@ namespace llvm {
class MCStreamer {
public:
enum SymbolAttr {
Global,
Weak,
PrivateExtern
Global, /// .globl
Hidden, /// .hidden (ELF)
IndirectSymbol, /// .indirect_symbol (Apple)
Internal, /// .internal (ELF)
LazyReference, /// .lazy_reference (Apple)
NoDeadStrip, /// .no_dead_strip (Apple)
PrivateExtern, /// .private_extern (Apple)
Protected, /// .protected (ELF)
Reference, /// .reference (Apple)
Weak, /// .weak
WeakDefinition, /// .weak_definition (Apple)
WeakReference, /// .weak_reference (Apple)
SymbolAttrFirst = Global,
SymbolAttrLast = WeakReference
};
private:

View File

@ -102,8 +102,17 @@ void MCAsmStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
SymbolAttr Attribute) {
switch (Attribute) {
case Global: OS << ".globl"; break;
case Weak: OS << ".weak"; break;
case Hidden: OS << ".hidden"; break;
case IndirectSymbol: OS << ".indirect_symbol"; break;
case Internal: OS << ".internal"; break;
case LazyReference: OS << ".lazy_reference"; break;
case NoDeadStrip: OS << ".no_dead_strip"; break;
case PrivateExtern: OS << ".private_extern"; break;
case Protected: OS << ".protected"; break;
case Reference: OS << ".reference"; break;
case Weak: OS << ".weak"; break;
case WeakDefinition: OS << ".weak_definition"; break;
case WeakReference: OS << ".weak_reference"; break;
}
OS << ' ' << Symbol->getName() << '\n';