File indexing completed on 2026-05-10 08:44:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef LLVM_MC_MCVALUE_H
0014 #define LLVM_MC_MCVALUE_H
0015
0016 #include "llvm/MC/MCExpr.h"
0017 #include "llvm/Support/DataTypes.h"
0018
0019 namespace llvm {
0020 class raw_ostream;
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 class MCValue {
0037 const MCSymbolRefExpr *SymA = nullptr, *SymB = nullptr;
0038 int64_t Cst = 0;
0039 uint32_t RefKind = 0;
0040
0041 public:
0042 MCValue() = default;
0043 int64_t getConstant() const { return Cst; }
0044 const MCSymbolRefExpr *getSymA() const { return SymA; }
0045 const MCSymbolRefExpr *getSymB() const { return SymB; }
0046 uint32_t getRefKind() const { return RefKind; }
0047
0048
0049 bool isAbsolute() const { return !SymA && !SymB; }
0050
0051
0052 void print(raw_ostream &OS) const;
0053
0054
0055 void dump() const;
0056
0057 MCSymbolRefExpr::VariantKind getAccessVariant() const;
0058
0059 static MCValue get(const MCSymbolRefExpr *SymA,
0060 const MCSymbolRefExpr *SymB = nullptr,
0061 int64_t Val = 0, uint32_t RefKind = 0) {
0062 MCValue R;
0063 R.Cst = Val;
0064 R.SymA = SymA;
0065 R.SymB = SymB;
0066 R.RefKind = RefKind;
0067 return R;
0068 }
0069
0070 static MCValue get(int64_t Val) {
0071 MCValue R;
0072 R.Cst = Val;
0073 R.SymA = nullptr;
0074 R.SymB = nullptr;
0075 R.RefKind = 0;
0076 return R;
0077 }
0078
0079 };
0080
0081 }
0082
0083 #endif