diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-01 06:21:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-01 06:21:53 +0000 |
commit | 14022f2a5a51d8ac0d8066a87dfd2dc2f2fabfdf (patch) | |
tree | c5fb30d7857581328e17b60754d52cbfea8762ce | |
parent | e18e0c58dcd740c64e962fefde44249d685d0568 (diff) | |
download | external_llvm-14022f2a5a51d8ac0d8066a87dfd2dc2f2fabfdf.zip external_llvm-14022f2a5a51d8ac0d8066a87dfd2dc2f2fabfdf.tar.gz external_llvm-14022f2a5a51d8ac0d8066a87dfd2dc2f2fabfdf.tar.bz2 |
add some comments to MCSymbol header, make the ctor private so that only MCContext can create these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74590 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 5f87f09..87698e3 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -6,6 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This file contains the declaration of the MCSymbol class. +// +//===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCSYMBOL_H #define LLVM_MC_MCSYMBOL_H @@ -14,17 +18,36 @@ namespace llvm { class MCSection; - + class MCContext; + + /// MCSymbol - Instances of this class represent a symbol name in the MC file, + /// and MCSymbols are created and unique'd by the MCContext class. + /// + /// If the symbol is defined/emitted into the current translation unit, the + /// Section member is set to indicate what section it lives in. Otherwise, if + /// it is a reference to an external entity, it has a null section. + /// class MCSymbol { - MCSection *Section; + /// Name - The name of the symbol. std::string Name; + /// Section - The section the symbol is defined in, or null if not defined + /// in this translation unit. + MCSection *Section; + + /// IsTemporary - True if this is an assembler temporary label, which + /// typically does not survive in the .o file's symbol table. Usually + /// "Lfoo" or ".foo". unsigned IsTemporary : 1; + + /// IsExternal - ? unsigned IsExternal : 1; - public: + private: // MCContext creates and uniques these. + friend class MCContext; MCSymbol(const char *_Name, bool _IsTemporary) - : Section(0), Name(_Name), IsTemporary(_IsTemporary), IsExternal(false) {} - + : Name(_Name), Section(0), IsTemporary(_IsTemporary), IsExternal(false) {} + public: + MCSection *getSection() const { return Section; } void setSection(MCSection *Value) { Section = Value; } |