private:
ExprKind Kind;
- MCExpr(const MCExpr&) LLVM_DELETED_FUNCTION;
- void operator=(const MCExpr&) LLVM_DELETED_FUNCTION;
+ MCExpr(const MCExpr&) = delete;
+ void operator=(const MCExpr&) = delete;
bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
const MCAsmLayout *Layout,
VK_ARM_TARGET1,
VK_ARM_TARGET2,
VK_ARM_PREL31,
+ VK_ARM_SBREL, // symbol(sbrel)
VK_ARM_TLSLDO, // symbol(tlsldo)
VK_ARM_TLSCALL, // symbol(tlscall)
VK_ARM_TLSDESC, // symbol(tlsdesc)
VK_PPC_GOT_TLSLD_HI, // symbol@got@tlsld@h
VK_PPC_GOT_TLSLD_HA, // symbol@got@tlsld@ha
VK_PPC_TLSLD, // symbol@tlsld
+ VK_PPC_LOCAL, // symbol@local
VK_Mips_GPREL,
VK_Mips_GOT_CALL,
};
private:
- /// The symbol being referenced.
- const MCSymbol *Symbol;
-
/// The symbol reference modifier.
- const VariantKind Kind;
+ const unsigned Kind : 16;
- /// MCAsmInfo that is used to print symbol variants correctly.
- const MCAsmInfo *MAI;
+ /// Specifies how the variant kind should be printed.
+ const unsigned UseParensForSymbolVariant : 1;
- explicit MCSymbolRefExpr(const MCSymbol *_Symbol, VariantKind _Kind,
- const MCAsmInfo *_MAI)
- : MCExpr(MCExpr::SymbolRef), Symbol(_Symbol), Kind(_Kind), MAI(_MAI) {
- assert(Symbol);
- assert(MAI);
- }
+ // FIXME: Remove this bit.
+ const unsigned HasSubsectionsViaSymbols : 1;
+
+ /// The symbol being referenced.
+ const MCSymbol *Symbol;
+
+ explicit MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
+ const MCAsmInfo *MAI);
public:
/// @name Construction
/// @{
const MCSymbol &getSymbol() const { return *Symbol; }
- const MCAsmInfo &getMCAsmInfo() const { return *MAI; }
- VariantKind getKind() const { return Kind; }
+ VariantKind getKind() const { return static_cast<VariantKind>(Kind); }
+
+ void printVariantKind(raw_ostream &OS) const;
+
+ bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
/// @}
/// @name Static Utility Functions