1 //===-- llvm/MC/MCValue.h - MCValue class -----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declaration of the MCValue class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_MC_MCVALUE_H
15 #define LLVM_MC_MCVALUE_H
17 #include "llvm/Support/DataTypes.h"
22 /// MCValue - This represents an "assembler immediate". In its most general
23 /// form, this can hold "SymbolA - SymbolB + imm64". Not all targets supports
24 /// relocations of this general form, but we need to represent this anyway.
26 /// Note that this class must remain a simple POD value class, because we need
27 /// it to live in unions etc.
29 MCSymbol *SymA, *SymB;
33 int64_t getConstant() const { return Cst; }
34 MCSymbol *getSymA() const { return SymA; }
35 MCSymbol *getSymB() const { return SymB; }
37 bool isConstant() const { return !SymA && !SymB; }
39 static MCValue get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) {
47 static MCValue get(int64_t Val) {
57 } // end namespace llvm