diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /include/llvm/MC/MCValue.h | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'include/llvm/MC/MCValue.h')
-rw-r--r-- | include/llvm/MC/MCValue.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/include/llvm/MC/MCValue.h b/include/llvm/MC/MCValue.h index d032f17..62aca6e 100644 --- a/include/llvm/MC/MCValue.h +++ b/include/llvm/MC/MCValue.h @@ -20,6 +20,7 @@ namespace llvm { class MCSymbol; +class raw_ostream; /// MCValue - This represents an "assembler immediate". In its most general /// form, this can hold "SymbolA - SymbolB + imm64". Not all targets supports @@ -32,13 +33,13 @@ class MCSymbol; /// Note that this class must remain a simple POD value class, because we need /// it to live in unions etc. class MCValue { - MCSymbol *SymA, *SymB; + const MCSymbol *SymA, *SymB; int64_t Cst; public: int64_t getConstant() const { return Cst; } - MCSymbol *getSymA() const { return SymA; } - MCSymbol *getSymB() const { return SymB; } + const MCSymbol *getSymA() const { return SymA; } + const MCSymbol *getSymB() const { return SymB; } /// isAbsolute - Is this an absolute (as opposed to relocatable) value. bool isAbsolute() const { return !SymA && !SymB; } @@ -48,11 +49,19 @@ public: /// /// @result - The value's associated section, or null for external or constant /// values. - MCSection *getAssociatedSection() const { - return SymA ? SymA->getSection() : 0; - } + // + // FIXME: Switch to a tagged section, so this can return the tagged section + // value. + const MCSection *getAssociatedSection() const; + + /// print - Print the value to the stream \arg OS. + void print(raw_ostream &OS, const MCAsmInfo *MAI) const; + + /// dump - Print the value to stderr. + void dump() const; - static MCValue get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) { + static MCValue get(const MCSymbol *SymA, const MCSymbol *SymB = 0, + int64_t Val = 0) { MCValue R; assert((!SymB || SymA) && "Invalid relocatable MCValue!"); R.Cst = Val; |