X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCSymbol.h;h=fe927555c49b1bd1c054bf8c0d336dd1b7344864;hb=9ba9d4d76bfa8de2b05cbce02a5a3ff7d46cb331;hp=99e705e596f130dc0537a49ea62e5841a06bcf31;hpb=db9835d0895337eb94c19e3a30b7d3fc8fcddfd5;p=oota-llvm.git diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 99e705e596f..fe927555c49 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -15,6 +15,7 @@ #define LLVM_MC_MCSYMBOL_H #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Compiler.h" namespace llvm { class MCExpr; @@ -56,13 +57,14 @@ namespace llvm { mutable unsigned IsUsed : 1; private: // MCContext creates and uniques these. + friend class MCExpr; friend class MCContext; MCSymbol(StringRef name, bool isTemporary) : Name(name), Section(0), Value(0), IsTemporary(isTemporary), IsUsed(false) {} - MCSymbol(const MCSymbol&); // DO NOT IMPLEMENT - void operator=(const MCSymbol&); // DO NOT IMPLEMENT + MCSymbol(const MCSymbol&) LLVM_DELETED_FUNCTION; + void operator=(const MCSymbol&) LLVM_DELETED_FUNCTION; public: /// getName - Get the symbol name. StringRef getName() const { return Name; } @@ -111,7 +113,7 @@ namespace llvm { return *Section; } - /// setSection - Mark the symbol as defined in the section \arg S. + /// setSection - Mark the symbol as defined in the section \p S. void setSection(const MCSection &S) { Section = &S; } /// setUndefined - Mark the symbol as undefined. @@ -131,18 +133,23 @@ namespace llvm { return Value != 0; } - /// getValue() - Get the value for variable symbols. + /// getVariableValue() - Get the value for variable symbols. const MCExpr *getVariableValue() const { assert(isVariable() && "Invalid accessor!"); IsUsed = true; return Value; } + // AliasedSymbol() - If this is an alias (a = b), return the symbol + // we ultimately point to. For a non alias, this just returns the symbol + // itself. + const MCSymbol &AliasedSymbol() const; + void setVariableValue(const MCExpr *Value); /// @} - /// print - Print the value to the stream \arg OS. + /// print - Print the value to the stream \p OS. void print(raw_ostream &OS) const; /// dump - Print the value to stderr.