MCExpr.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. //===- MCExpr.h - Assembly Level Expressions --------------------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLVM_MC_MCEXPR_H
  10. #define LLVM_MC_MCEXPR_H
  11. #include "llvm/ADT/DenseMap.h"
  12. #include "llvm/Support/Casting.h"
  13. #include "llvm/Support/DataTypes.h"
  14. namespace llvm {
  15. class MCAsmInfo;
  16. class MCAsmLayout;
  17. class MCAssembler;
  18. class MCContext;
  19. class MCFixup;
  20. class MCSection;
  21. class MCStreamer;
  22. class MCSymbol;
  23. class MCValue;
  24. class raw_ostream;
  25. class StringRef;
  26. typedef DenseMap<const MCSection *, uint64_t> SectionAddrMap;
  27. /// \brief Base class for the full range of assembler expressions which are
  28. /// needed for parsing.
  29. class MCExpr {
  30. public:
  31. enum ExprKind {
  32. Binary, ///< Binary expressions.
  33. Constant, ///< Constant expressions.
  34. SymbolRef, ///< References to labels and assigned expressions.
  35. Unary, ///< Unary expressions.
  36. Target ///< Target specific expression.
  37. };
  38. private:
  39. ExprKind Kind;
  40. MCExpr(const MCExpr&) = delete;
  41. void operator=(const MCExpr&) = delete;
  42. bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
  43. const MCAsmLayout *Layout,
  44. const SectionAddrMap *Addrs) const;
  45. bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
  46. const MCAsmLayout *Layout,
  47. const SectionAddrMap *Addrs, bool InSet) const;
  48. protected:
  49. explicit MCExpr(ExprKind Kind) : Kind(Kind) {}
  50. bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
  51. const MCAsmLayout *Layout,
  52. const MCFixup *Fixup,
  53. const SectionAddrMap *Addrs, bool InSet) const;
  54. public:
  55. /// \name Accessors
  56. /// @{
  57. ExprKind getKind() const { return Kind; }
  58. /// @}
  59. /// \name Utility Methods
  60. /// @{
  61. void print(raw_ostream &OS, const MCAsmInfo *MAI) const;
  62. void dump() const;
  63. /// @}
  64. /// \name Expression Evaluation
  65. /// @{
  66. /// \brief Try to evaluate the expression to an absolute value.
  67. ///
  68. /// \param Res - The absolute value, if evaluation succeeds.
  69. /// \param Layout - The assembler layout object to use for evaluating symbol
  70. /// values. If not given, then only non-symbolic expressions will be
  71. /// evaluated.
  72. /// \return - True on success.
  73. bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
  74. const SectionAddrMap &Addrs) const;
  75. bool evaluateAsAbsolute(int64_t &Res) const;
  76. bool evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
  77. bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
  78. bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
  79. /// \brief Try to evaluate the expression to a relocatable value, i.e. an
  80. /// expression of the fixed form (a - b + constant).
  81. ///
  82. /// \param Res - The relocatable value, if evaluation succeeds.
  83. /// \param Layout - The assembler layout object to use for evaluating values.
  84. /// \param Fixup - The Fixup object if available.
  85. /// \return - True on success.
  86. bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout,
  87. const MCFixup *Fixup) const;
  88. /// \brief Try to evaluate the expression to the form (a - b + constant) where
  89. /// neither a nor b are variables.
  90. ///
  91. /// This is a more aggressive variant of evaluateAsRelocatable. The intended
  92. /// use is for when relocations are not available, like the .size directive.
  93. bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const;
  94. /// \brief Find the "associated section" for this expression, which is
  95. /// currently defined as the absolute section for constants, or
  96. /// otherwise the section associated with the first defined symbol in the
  97. /// expression.
  98. MCSection *findAssociatedSection() const;
  99. /// @}
  100. };
  101. inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) {
  102. E.print(OS, nullptr);
  103. return OS;
  104. }
  105. //// \brief Represent a constant integer expression.
  106. class MCConstantExpr : public MCExpr {
  107. int64_t Value;
  108. explicit MCConstantExpr(int64_t Value)
  109. : MCExpr(MCExpr::Constant), Value(Value) {}
  110. public:
  111. /// \name Construction
  112. /// @{
  113. static const MCConstantExpr *create(int64_t Value, MCContext &Ctx);
  114. /// @}
  115. /// \name Accessors
  116. /// @{
  117. int64_t getValue() const { return Value; }
  118. /// @}
  119. static bool classof(const MCExpr *E) {
  120. return E->getKind() == MCExpr::Constant;
  121. }
  122. };
  123. /// \brief Represent a reference to a symbol from inside an expression.
  124. ///
  125. /// A symbol reference in an expression may be a use of a label, a use of an
  126. /// assembler variable (defined constant), or constitute an implicit definition
  127. /// of the symbol as external.
  128. class MCSymbolRefExpr : public MCExpr {
  129. public:
  130. enum VariantKind : uint16_t {
  131. VK_None,
  132. VK_Invalid,
  133. VK_GOT,
  134. VK_GOTOFF,
  135. VK_GOTPCREL,
  136. VK_GOTTPOFF,
  137. VK_INDNTPOFF,
  138. VK_NTPOFF,
  139. VK_GOTNTPOFF,
  140. VK_PLT,
  141. VK_TLSGD,
  142. VK_TLSLD,
  143. VK_TLSLDM,
  144. VK_TPOFF,
  145. VK_DTPOFF,
  146. VK_TLVP, // Mach-O thread local variable relocations
  147. VK_TLVPPAGE,
  148. VK_TLVPPAGEOFF,
  149. VK_PAGE,
  150. VK_PAGEOFF,
  151. VK_GOTPAGE,
  152. VK_GOTPAGEOFF,
  153. VK_SECREL,
  154. VK_SIZE, // symbol@SIZE
  155. VK_WEAKREF, // The link between the symbols in .weakref foo, bar
  156. VK_ARM_NONE,
  157. VK_ARM_TARGET1,
  158. VK_ARM_TARGET2,
  159. VK_ARM_PREL31,
  160. VK_ARM_SBREL, // symbol(sbrel)
  161. VK_ARM_TLSLDO, // symbol(tlsldo)
  162. VK_ARM_TLSCALL, // symbol(tlscall)
  163. VK_ARM_TLSDESC, // symbol(tlsdesc)
  164. VK_ARM_TLSDESCSEQ,
  165. VK_PPC_LO, // symbol@l
  166. VK_PPC_HI, // symbol@h
  167. VK_PPC_HA, // symbol@ha
  168. VK_PPC_HIGHER, // symbol@higher
  169. VK_PPC_HIGHERA, // symbol@highera
  170. VK_PPC_HIGHEST, // symbol@highest
  171. VK_PPC_HIGHESTA, // symbol@highesta
  172. VK_PPC_GOT_LO, // symbol@got@l
  173. VK_PPC_GOT_HI, // symbol@got@h
  174. VK_PPC_GOT_HA, // symbol@got@ha
  175. VK_PPC_TOCBASE, // symbol@tocbase
  176. VK_PPC_TOC, // symbol@toc
  177. VK_PPC_TOC_LO, // symbol@toc@l
  178. VK_PPC_TOC_HI, // symbol@toc@h
  179. VK_PPC_TOC_HA, // symbol@toc@ha
  180. VK_PPC_DTPMOD, // symbol@dtpmod
  181. VK_PPC_TPREL, // symbol@tprel
  182. VK_PPC_TPREL_LO, // symbol@tprel@l
  183. VK_PPC_TPREL_HI, // symbol@tprel@h
  184. VK_PPC_TPREL_HA, // symbol@tprel@ha
  185. VK_PPC_TPREL_HIGHER, // symbol@tprel@higher
  186. VK_PPC_TPREL_HIGHERA, // symbol@tprel@highera
  187. VK_PPC_TPREL_HIGHEST, // symbol@tprel@highest
  188. VK_PPC_TPREL_HIGHESTA, // symbol@tprel@highesta
  189. VK_PPC_DTPREL, // symbol@dtprel
  190. VK_PPC_DTPREL_LO, // symbol@dtprel@l
  191. VK_PPC_DTPREL_HI, // symbol@dtprel@h
  192. VK_PPC_DTPREL_HA, // symbol@dtprel@ha
  193. VK_PPC_DTPREL_HIGHER, // symbol@dtprel@higher
  194. VK_PPC_DTPREL_HIGHERA, // symbol@dtprel@highera
  195. VK_PPC_DTPREL_HIGHEST, // symbol@dtprel@highest
  196. VK_PPC_DTPREL_HIGHESTA,// symbol@dtprel@highesta
  197. VK_PPC_GOT_TPREL, // symbol@got@tprel
  198. VK_PPC_GOT_TPREL_LO, // symbol@got@tprel@l
  199. VK_PPC_GOT_TPREL_HI, // symbol@got@tprel@h
  200. VK_PPC_GOT_TPREL_HA, // symbol@got@tprel@ha
  201. VK_PPC_GOT_DTPREL, // symbol@got@dtprel
  202. VK_PPC_GOT_DTPREL_LO, // symbol@got@dtprel@l
  203. VK_PPC_GOT_DTPREL_HI, // symbol@got@dtprel@h
  204. VK_PPC_GOT_DTPREL_HA, // symbol@got@dtprel@ha
  205. VK_PPC_TLS, // symbol@tls
  206. VK_PPC_GOT_TLSGD, // symbol@got@tlsgd
  207. VK_PPC_GOT_TLSGD_LO, // symbol@got@tlsgd@l
  208. VK_PPC_GOT_TLSGD_HI, // symbol@got@tlsgd@h
  209. VK_PPC_GOT_TLSGD_HA, // symbol@got@tlsgd@ha
  210. VK_PPC_TLSGD, // symbol@tlsgd
  211. VK_PPC_GOT_TLSLD, // symbol@got@tlsld
  212. VK_PPC_GOT_TLSLD_LO, // symbol@got@tlsld@l
  213. VK_PPC_GOT_TLSLD_HI, // symbol@got@tlsld@h
  214. VK_PPC_GOT_TLSLD_HA, // symbol@got@tlsld@ha
  215. VK_PPC_TLSLD, // symbol@tlsld
  216. VK_PPC_LOCAL, // symbol@local
  217. VK_Mips_GPREL,
  218. VK_Mips_GOT_CALL,
  219. VK_Mips_GOT16,
  220. VK_Mips_GOT,
  221. VK_Mips_ABS_HI,
  222. VK_Mips_ABS_LO,
  223. VK_Mips_TLSGD,
  224. VK_Mips_TLSLDM,
  225. VK_Mips_DTPREL_HI,
  226. VK_Mips_DTPREL_LO,
  227. VK_Mips_GOTTPREL,
  228. VK_Mips_TPREL_HI,
  229. VK_Mips_TPREL_LO,
  230. VK_Mips_GPOFF_HI,
  231. VK_Mips_GPOFF_LO,
  232. VK_Mips_GOT_DISP,
  233. VK_Mips_GOT_PAGE,
  234. VK_Mips_GOT_OFST,
  235. VK_Mips_HIGHER,
  236. VK_Mips_HIGHEST,
  237. VK_Mips_GOT_HI16,
  238. VK_Mips_GOT_LO16,
  239. VK_Mips_CALL_HI16,
  240. VK_Mips_CALL_LO16,
  241. VK_Mips_PCREL_HI16,
  242. VK_Mips_PCREL_LO16,
  243. VK_COFF_IMGREL32, // symbol@imgrel (image-relative)
  244. VK_Hexagon_PCREL,
  245. VK_Hexagon_LO16,
  246. VK_Hexagon_HI16,
  247. VK_Hexagon_GPREL,
  248. VK_Hexagon_GD_GOT,
  249. VK_Hexagon_LD_GOT,
  250. VK_Hexagon_GD_PLT,
  251. VK_Hexagon_LD_PLT,
  252. VK_Hexagon_IE,
  253. VK_Hexagon_IE_GOT,
  254. VK_TPREL,
  255. VK_DTPREL
  256. };
  257. private:
  258. /// The symbol reference modifier.
  259. const VariantKind Kind;
  260. /// Specifies how the variant kind should be printed.
  261. const unsigned UseParensForSymbolVariant : 1;
  262. // FIXME: Remove this bit.
  263. const unsigned HasSubsectionsViaSymbols : 1;
  264. /// The symbol being referenced.
  265. const MCSymbol *Symbol;
  266. explicit MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
  267. const MCAsmInfo *MAI);
  268. public:
  269. /// \name Construction
  270. /// @{
  271. static const MCSymbolRefExpr *create(const MCSymbol *Symbol, MCContext &Ctx) {
  272. return MCSymbolRefExpr::create(Symbol, VK_None, Ctx);
  273. }
  274. static const MCSymbolRefExpr *create(const MCSymbol *Symbol, VariantKind Kind,
  275. MCContext &Ctx);
  276. static const MCSymbolRefExpr *create(StringRef Name, VariantKind Kind,
  277. MCContext &Ctx);
  278. /// @}
  279. /// \name Accessors
  280. /// @{
  281. const MCSymbol &getSymbol() const { return *Symbol; }
  282. VariantKind getKind() const { return Kind; }
  283. void printVariantKind(raw_ostream &OS) const;
  284. bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
  285. /// @}
  286. /// \name Static Utility Functions
  287. /// @{
  288. static StringRef getVariantKindName(VariantKind Kind);
  289. static VariantKind getVariantKindForName(StringRef Name);
  290. /// @}
  291. static bool classof(const MCExpr *E) {
  292. return E->getKind() == MCExpr::SymbolRef;
  293. }
  294. };
  295. /// \brief Unary assembler expressions.
  296. class MCUnaryExpr : public MCExpr {
  297. public:
  298. enum Opcode {
  299. LNot, ///< Logical negation.
  300. Minus, ///< Unary minus.
  301. Not, ///< Bitwise negation.
  302. Plus ///< Unary plus.
  303. };
  304. private:
  305. Opcode Op;
  306. const MCExpr *Expr;
  307. MCUnaryExpr(Opcode Op, const MCExpr *Expr)
  308. : MCExpr(MCExpr::Unary), Op(Op), Expr(Expr) {}
  309. public:
  310. /// \name Construction
  311. /// @{
  312. static const MCUnaryExpr *create(Opcode Op, const MCExpr *Expr,
  313. MCContext &Ctx);
  314. static const MCUnaryExpr *createLNot(const MCExpr *Expr, MCContext &Ctx) {
  315. return create(LNot, Expr, Ctx);
  316. }
  317. static const MCUnaryExpr *createMinus(const MCExpr *Expr, MCContext &Ctx) {
  318. return create(Minus, Expr, Ctx);
  319. }
  320. static const MCUnaryExpr *createNot(const MCExpr *Expr, MCContext &Ctx) {
  321. return create(Not, Expr, Ctx);
  322. }
  323. static const MCUnaryExpr *createPlus(const MCExpr *Expr, MCContext &Ctx) {
  324. return create(Plus, Expr, Ctx);
  325. }
  326. /// @}
  327. /// \name Accessors
  328. /// @{
  329. /// \brief Get the kind of this unary expression.
  330. Opcode getOpcode() const { return Op; }
  331. /// \brief Get the child of this unary expression.
  332. const MCExpr *getSubExpr() const { return Expr; }
  333. /// @}
  334. static bool classof(const MCExpr *E) {
  335. return E->getKind() == MCExpr::Unary;
  336. }
  337. };
  338. /// \brief Binary assembler expressions.
  339. class MCBinaryExpr : public MCExpr {
  340. public:
  341. enum Opcode {
  342. Add, ///< Addition.
  343. And, ///< Bitwise and.
  344. Div, ///< Signed division.
  345. EQ, ///< Equality comparison.
  346. GT, ///< Signed greater than comparison (result is either 0 or some
  347. ///< target-specific non-zero value)
  348. GTE, ///< Signed greater than or equal comparison (result is either 0 or
  349. ///< some target-specific non-zero value).
  350. LAnd, ///< Logical and.
  351. LOr, ///< Logical or.
  352. LT, ///< Signed less than comparison (result is either 0 or
  353. ///< some target-specific non-zero value).
  354. LTE, ///< Signed less than or equal comparison (result is either 0 or
  355. ///< some target-specific non-zero value).
  356. Mod, ///< Signed remainder.
  357. Mul, ///< Multiplication.
  358. NE, ///< Inequality comparison.
  359. Or, ///< Bitwise or.
  360. Shl, ///< Shift left.
  361. AShr, ///< Arithmetic shift right.
  362. LShr, ///< Logical shift right.
  363. Sub, ///< Subtraction.
  364. Xor ///< Bitwise exclusive or.
  365. };
  366. private:
  367. Opcode Op;
  368. const MCExpr *LHS, *RHS;
  369. MCBinaryExpr(Opcode Op, const MCExpr *LHS, const MCExpr *RHS)
  370. : MCExpr(MCExpr::Binary), Op(Op), LHS(LHS), RHS(RHS) {}
  371. public:
  372. /// \name Construction
  373. /// @{
  374. static const MCBinaryExpr *create(Opcode Op, const MCExpr *LHS,
  375. const MCExpr *RHS, MCContext &Ctx);
  376. static const MCBinaryExpr *createAdd(const MCExpr *LHS, const MCExpr *RHS,
  377. MCContext &Ctx) {
  378. return create(Add, LHS, RHS, Ctx);
  379. }
  380. static const MCBinaryExpr *createAnd(const MCExpr *LHS, const MCExpr *RHS,
  381. MCContext &Ctx) {
  382. return create(And, LHS, RHS, Ctx);
  383. }
  384. static const MCBinaryExpr *createDiv(const MCExpr *LHS, const MCExpr *RHS,
  385. MCContext &Ctx) {
  386. return create(Div, LHS, RHS, Ctx);
  387. }
  388. static const MCBinaryExpr *createEQ(const MCExpr *LHS, const MCExpr *RHS,
  389. MCContext &Ctx) {
  390. return create(EQ, LHS, RHS, Ctx);
  391. }
  392. static const MCBinaryExpr *createGT(const MCExpr *LHS, const MCExpr *RHS,
  393. MCContext &Ctx) {
  394. return create(GT, LHS, RHS, Ctx);
  395. }
  396. static const MCBinaryExpr *createGTE(const MCExpr *LHS, const MCExpr *RHS,
  397. MCContext &Ctx) {
  398. return create(GTE, LHS, RHS, Ctx);
  399. }
  400. static const MCBinaryExpr *createLAnd(const MCExpr *LHS, const MCExpr *RHS,
  401. MCContext &Ctx) {
  402. return create(LAnd, LHS, RHS, Ctx);
  403. }
  404. static const MCBinaryExpr *createLOr(const MCExpr *LHS, const MCExpr *RHS,
  405. MCContext &Ctx) {
  406. return create(LOr, LHS, RHS, Ctx);
  407. }
  408. static const MCBinaryExpr *createLT(const MCExpr *LHS, const MCExpr *RHS,
  409. MCContext &Ctx) {
  410. return create(LT, LHS, RHS, Ctx);
  411. }
  412. static const MCBinaryExpr *createLTE(const MCExpr *LHS, const MCExpr *RHS,
  413. MCContext &Ctx) {
  414. return create(LTE, LHS, RHS, Ctx);
  415. }
  416. static const MCBinaryExpr *createMod(const MCExpr *LHS, const MCExpr *RHS,
  417. MCContext &Ctx) {
  418. return create(Mod, LHS, RHS, Ctx);
  419. }
  420. static const MCBinaryExpr *createMul(const MCExpr *LHS, const MCExpr *RHS,
  421. MCContext &Ctx) {
  422. return create(Mul, LHS, RHS, Ctx);
  423. }
  424. static const MCBinaryExpr *createNE(const MCExpr *LHS, const MCExpr *RHS,
  425. MCContext &Ctx) {
  426. return create(NE, LHS, RHS, Ctx);
  427. }
  428. static const MCBinaryExpr *createOr(const MCExpr *LHS, const MCExpr *RHS,
  429. MCContext &Ctx) {
  430. return create(Or, LHS, RHS, Ctx);
  431. }
  432. static const MCBinaryExpr *createShl(const MCExpr *LHS, const MCExpr *RHS,
  433. MCContext &Ctx) {
  434. return create(Shl, LHS, RHS, Ctx);
  435. }
  436. static const MCBinaryExpr *createAShr(const MCExpr *LHS, const MCExpr *RHS,
  437. MCContext &Ctx) {
  438. return create(AShr, LHS, RHS, Ctx);
  439. }
  440. static const MCBinaryExpr *createLShr(const MCExpr *LHS, const MCExpr *RHS,
  441. MCContext &Ctx) {
  442. return create(LShr, LHS, RHS, Ctx);
  443. }
  444. static const MCBinaryExpr *createSub(const MCExpr *LHS, const MCExpr *RHS,
  445. MCContext &Ctx) {
  446. return create(Sub, LHS, RHS, Ctx);
  447. }
  448. static const MCBinaryExpr *createXor(const MCExpr *LHS, const MCExpr *RHS,
  449. MCContext &Ctx) {
  450. return create(Xor, LHS, RHS, Ctx);
  451. }
  452. /// @}
  453. /// \name Accessors
  454. /// @{
  455. /// \brief Get the kind of this binary expression.
  456. Opcode getOpcode() const { return Op; }
  457. /// \brief Get the left-hand side expression of the binary operator.
  458. const MCExpr *getLHS() const { return LHS; }
  459. /// \brief Get the right-hand side expression of the binary operator.
  460. const MCExpr *getRHS() const { return RHS; }
  461. /// @}
  462. static bool classof(const MCExpr *E) {
  463. return E->getKind() == MCExpr::Binary;
  464. }
  465. };
  466. /// \brief This is an extension point for target-specific MCExpr subclasses to
  467. /// implement.
  468. ///
  469. /// NOTE: All subclasses are required to have trivial destructors because
  470. /// MCExprs are bump pointer allocated and not destructed.
  471. class MCTargetExpr : public MCExpr {
  472. virtual void anchor();
  473. protected:
  474. MCTargetExpr() : MCExpr(Target) {}
  475. virtual ~MCTargetExpr() {}
  476. public:
  477. virtual void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const = 0;
  478. virtual bool evaluateAsRelocatableImpl(MCValue &Res,
  479. const MCAsmLayout *Layout,
  480. const MCFixup *Fixup) const = 0;
  481. virtual void visitUsedExpr(MCStreamer& Streamer) const = 0;
  482. virtual MCSection *findAssociatedSection() const = 0;
  483. virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const = 0;
  484. static bool classof(const MCExpr *E) {
  485. return E->getKind() == MCExpr::Target;
  486. }
  487. };
  488. } // end namespace llvm
  489. #endif