diff options
Diffstat (limited to 'include/llvm/MC')
-rw-r--r-- | include/llvm/MC/MCDirectives.h | 44 | ||||
-rw-r--r-- | include/llvm/MC/MCParser/AsmParser.h | 2 | ||||
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 30 |
3 files changed, 48 insertions, 28 deletions
diff --git a/include/llvm/MC/MCDirectives.h b/include/llvm/MC/MCDirectives.h new file mode 100644 index 0000000..57ce75d --- /dev/null +++ b/include/llvm/MC/MCDirectives.h @@ -0,0 +1,44 @@ +//===- MCDirectives.h - Enums for directives on various targets -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines various enums that represent target-specific directives. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCDIRECTIVES_H +#define LLVM_MC_MCDIRECTIVES_H + +namespace llvm { + +enum MCSymbolAttr { + MCSA_Invalid = 0, /// Not a valid directive. + + // Various directives in alphabetical order. + MCSA_Global, /// .globl + MCSA_Hidden, /// .hidden (ELF) + MCSA_IndirectSymbol, /// .indirect_symbol (MachO) + MCSA_Internal, /// .internal (ELF) + MCSA_LazyReference, /// .lazy_reference (MachO) + MCSA_Local, /// .local (ELF) + MCSA_NoDeadStrip, /// .no_dead_strip (MachO) + MCSA_PrivateExtern, /// .private_extern (MachO) + MCSA_Protected, /// .protected (ELF) + MCSA_Reference, /// .reference (MachO) + MCSA_Weak, /// .weak + MCSA_WeakDefinition, /// .weak_definition (MachO) + MCSA_WeakReference /// .weak_reference (MachO) +}; + +enum MCAssemblerFlag { + MCAF_SubsectionsViaSymbols /// .subsections_via_symbols (MachO) +}; + +} // end namespace llvm + +#endif diff --git a/include/llvm/MC/MCParser/AsmParser.h b/include/llvm/MC/MCParser/AsmParser.h index 65cdc16..f82584c 100644 --- a/include/llvm/MC/MCParser/AsmParser.h +++ b/include/llvm/MC/MCParser/AsmParser.h @@ -144,7 +144,7 @@ private: /// ParseDirectiveSymbolAttribute - Parse a directive like ".globl" which /// accepts a single symbol (which should be a label or an external). - bool ParseDirectiveSymbolAttribute(MCStreamer::SymbolAttr Attr); + bool ParseDirectiveSymbolAttribute(MCSymbolAttr Attr); bool ParseDirectiveDarwinSymbolDesc(); // Darwin specific ".desc" bool ParseDirectiveDarwinLsym(); // Darwin specific ".lsym" diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 3f567e9..2e55f99 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -15,6 +15,7 @@ #define LLVM_MC_MCSTREAMER_H #include "llvm/System/DataTypes.h" +#include "llvm/MC/MCDirectives.h" namespace llvm { class MCAsmInfo; @@ -40,31 +41,6 @@ namespace llvm { /// a .s file, and implementations that write out .o files of various formats. /// class MCStreamer { - public: - enum SymbolAttr { - Global, /// .globl - Hidden, /// .hidden (ELF) - IndirectSymbol, /// .indirect_symbol (Apple) - Internal, /// .internal (ELF) - LazyReference, /// .lazy_reference (Apple) - Local, /// .local (ELF) - 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 - }; - - enum AssemblerFlag { - SubsectionsViaSymbols /// .subsections_via_symbols (Apple) - }; - - private: MCContext &Context; MCStreamer(const MCStreamer&); // DO NOT IMPLEMENT @@ -128,7 +104,7 @@ namespace llvm { virtual void EmitLabel(MCSymbol *Symbol) = 0; /// EmitAssemblerFlag - Note in the output the specified @param Flag - virtual void EmitAssemblerFlag(AssemblerFlag Flag) = 0; + virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0; /// EmitAssignment - Emit an assignment of @param Value to @param Symbol. /// @@ -145,7 +121,7 @@ namespace llvm { /// EmitSymbolAttribute - Add the given @param Attribute to @param Symbol. virtual void EmitSymbolAttribute(MCSymbol *Symbol, - SymbolAttr Attribute) = 0; + MCSymbolAttr Attribute) = 0; /// EmitSymbolDesc - Set the @param DescValue for the @param Symbol. /// |