X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCExpr.h;h=c017fef8b5a59f54c164d49daa202001299721fa;hb=71706a01b0cd04378575f953b49b1289c3e8de9a;hp=6536aaa0f8fe45945fac28917fd7fa2ffa1f231a;hpb=b2b363408b8cec828681a1264f4438b41b834042;p=oota-llvm.git diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h index 6536aaa0f8f..c017fef8b5a 100644 --- a/include/llvm/MC/MCExpr.h +++ b/include/llvm/MC/MCExpr.h @@ -44,12 +44,17 @@ public: 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, const SectionAddrMap *Addrs) const; + + bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm, + const MCAsmLayout *Layout, + const SectionAddrMap *Addrs, bool InSet) const; + protected: explicit MCExpr(ExprKind _Kind) : Kind(_Kind) {} @@ -89,6 +94,8 @@ public: bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const; bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const; + int64_t evaluateKnownAbsolute(const MCAsmLayout &Layout) const; + /// EvaluateAsRelocatable - Try to evaluate the expression to a relocatable /// value, i.e. an expression of the fixed form (a - b + constant). /// @@ -181,12 +188,14 @@ public: VK_GOTPAGE, VK_GOTPAGEOFF, VK_SECREL, + VK_SIZE, // symbol@SIZE VK_WEAKREF, // The link between the symbols in .weakref foo, bar VK_ARM_NONE, 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) @@ -243,6 +252,7 @@ public: 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, @@ -275,21 +285,20 @@ public: }; 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 @@ -309,9 +318,12 @@ public: /// @{ const MCSymbol &getSymbol() const { return *Symbol; } - const MCAsmInfo &getMCAsmInfo() const { return *MAI; } - VariantKind getKind() const { return Kind; } + VariantKind getKind() const { return static_cast(Kind); } + + void printVariantKind(raw_ostream &OS) const; + + bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; } /// @} /// @name Static Utility Functions