LLVM  14.0.0git
MCExpr.h
Go to the documentation of this file.
1 //===- MCExpr.h - Assembly Level Expressions --------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_MC_MCEXPR_H
10 #define LLVM_MC_MCEXPR_H
11 
12 #include "llvm/ADT/DenseMap.h"
13 #include "llvm/Support/SMLoc.h"
14 #include <cstdint>
15 
16 namespace llvm {
17 
18 class MCAsmInfo;
19 class MCAsmLayout;
20 class MCAssembler;
21 class MCContext;
22 class MCFixup;
23 class MCFragment;
24 class MCSection;
25 class MCStreamer;
26 class MCSymbol;
27 class MCValue;
28 class raw_ostream;
29 class StringRef;
30 
32 
33 /// Base class for the full range of assembler expressions which are
34 /// needed for parsing.
35 class MCExpr {
36 public:
37  enum ExprKind : uint8_t {
38  Binary, ///< Binary expressions.
39  Constant, ///< Constant expressions.
40  SymbolRef, ///< References to labels and assigned expressions.
41  Unary, ///< Unary expressions.
42  Target ///< Target specific expression.
43  };
44 
45 private:
46  static const unsigned NumSubclassDataBits = 24;
47  static_assert(
48  NumSubclassDataBits == CHAR_BIT * (sizeof(unsigned) - sizeof(ExprKind)),
49  "ExprKind and SubclassData together should take up one word");
50 
51  ExprKind Kind;
52  /// Field reserved for use by MCExpr subclasses.
53  unsigned SubclassData : NumSubclassDataBits;
54  SMLoc Loc;
55 
56  bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
57  const MCAsmLayout *Layout,
58  const SectionAddrMap *Addrs, bool InSet) const;
59 
60 protected:
61  explicit MCExpr(ExprKind Kind, SMLoc Loc, unsigned SubclassData = 0)
62  : Kind(Kind), SubclassData(SubclassData), Loc(Loc) {
63  assert(SubclassData < (1 << NumSubclassDataBits) &&
64  "Subclass data too large");
65  }
66 
68  const MCAsmLayout *Layout,
69  const MCFixup *Fixup,
70  const SectionAddrMap *Addrs, bool InSet) const;
71 
72  unsigned getSubclassData() const { return SubclassData; }
73 
74 public:
75  MCExpr(const MCExpr &) = delete;
76  MCExpr &operator=(const MCExpr &) = delete;
77 
78  /// \name Accessors
79  /// @{
80 
81  ExprKind getKind() const { return Kind; }
82  SMLoc getLoc() const { return Loc; }
83 
84  /// @}
85  /// \name Utility Methods
86  /// @{
87 
88  void print(raw_ostream &OS, const MCAsmInfo *MAI,
89  bool InParens = false) const;
90  void dump() const;
91 
92  /// @}
93  /// \name Expression Evaluation
94  /// @{
95 
96  /// Try to evaluate the expression to an absolute value.
97  ///
98  /// \param Res - The absolute value, if evaluation succeeds.
99  /// \param Layout - The assembler layout object to use for evaluating symbol
100  /// values. If not given, then only non-symbolic expressions will be
101  /// evaluated.
102  /// \return - True on success.
103  bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
104  const SectionAddrMap &Addrs) const;
105  bool evaluateAsAbsolute(int64_t &Res) const;
106  bool evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
107  bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm) const;
108  bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
109 
110  bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
111 
112  /// Try to evaluate the expression to a relocatable value, i.e. an
113  /// expression of the fixed form (a - b + constant).
114  ///
115  /// \param Res - The relocatable value, if evaluation succeeds.
116  /// \param Layout - The assembler layout object to use for evaluating values.
117  /// \param Fixup - The Fixup object if available.
118  /// \return - True on success.
119  bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout,
120  const MCFixup *Fixup) const;
121 
122  /// Try to evaluate the expression to the form (a - b + constant) where
123  /// neither a nor b are variables.
124  ///
125  /// This is a more aggressive variant of evaluateAsRelocatable. The intended
126  /// use is for when relocations are not available, like the .size directive.
127  bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const;
128 
129  /// Find the "associated section" for this expression, which is
130  /// currently defined as the absolute section for constants, or
131  /// otherwise the section associated with the first defined symbol in the
132  /// expression.
134 
135  /// @}
136 };
137 
138 inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) {
139  E.print(OS, nullptr);
140  return OS;
141 }
142 
143 //// Represent a constant integer expression.
144 class MCConstantExpr : public MCExpr {
145  int64_t Value;
146 
147  // Subclass data stores SizeInBytes in bits 0..7 and PrintInHex in bit 8.
148  static const unsigned SizeInBytesBits = 8;
149  static const unsigned SizeInBytesMask = (1 << SizeInBytesBits) - 1;
150  static const unsigned PrintInHexBit = 1 << SizeInBytesBits;
151 
152  static unsigned encodeSubclassData(bool PrintInHex, unsigned SizeInBytes) {
153  assert(SizeInBytes <= sizeof(int64_t) && "Excessive size");
154  return SizeInBytes | (PrintInHex ? PrintInHexBit : 0);
155  }
156 
157  MCConstantExpr(int64_t Value, bool PrintInHex, unsigned SizeInBytes)
159  encodeSubclassData(PrintInHex, SizeInBytes)), Value(Value) {}
160 
161 public:
162  /// \name Construction
163  /// @{
164 
165  static const MCConstantExpr *create(int64_t Value, MCContext &Ctx,
166  bool PrintInHex = false,
167  unsigned SizeInBytes = 0);
168 
169  /// @}
170  /// \name Accessors
171  /// @{
172 
173  int64_t getValue() const { return Value; }
174  unsigned getSizeInBytes() const {
175  return getSubclassData() & SizeInBytesMask;
176  }
177 
178  bool useHexFormat() const { return (getSubclassData() & PrintInHexBit) != 0; }
179 
180  /// @}
181 
182  static bool classof(const MCExpr *E) {
183  return E->getKind() == MCExpr::Constant;
184  }
185 };
186 
187 /// Represent a reference to a symbol from inside an expression.
188 ///
189 /// A symbol reference in an expression may be a use of a label, a use of an
190 /// assembler variable (defined constant), or constitute an implicit definition
191 /// of the symbol as external.
192 class MCSymbolRefExpr : public MCExpr {
193 public:
197 
213  VK_TLSCALL, // symbol(tlscall)
214  VK_TLSDESC, // symbol(tlsdesc)
215  VK_TLVP, // Mach-O thread local variable relocations
223  VK_SIZE, // symbol@SIZE
224  VK_WEAKREF, // The link between the symbols in .weakref foo, bar
225 
228 
234  VK_ARM_SBREL, // symbol(sbrel)
235  VK_ARM_TLSLDO, // symbol(tlsldo)
237 
246 
247  VK_PPC_LO, // symbol@l
248  VK_PPC_HI, // symbol@h
249  VK_PPC_HA, // symbol@ha
250  VK_PPC_HIGH, // symbol@high
251  VK_PPC_HIGHA, // symbol@higha
252  VK_PPC_HIGHER, // symbol@higher
253  VK_PPC_HIGHERA, // symbol@highera
254  VK_PPC_HIGHEST, // symbol@highest
255  VK_PPC_HIGHESTA, // symbol@highesta
256  VK_PPC_GOT_LO, // symbol@got@l
257  VK_PPC_GOT_HI, // symbol@got@h
258  VK_PPC_GOT_HA, // symbol@got@ha
259  VK_PPC_TOCBASE, // symbol@tocbase
260  VK_PPC_TOC, // symbol@toc
261  VK_PPC_TOC_LO, // symbol@toc@l
262  VK_PPC_TOC_HI, // symbol@toc@h
263  VK_PPC_TOC_HA, // symbol@toc@ha
264  VK_PPC_U, // symbol@u
265  VK_PPC_L, // symbol@l
266  VK_PPC_DTPMOD, // symbol@dtpmod
267  VK_PPC_TPREL_LO, // symbol@tprel@l
268  VK_PPC_TPREL_HI, // symbol@tprel@h
269  VK_PPC_TPREL_HA, // symbol@tprel@ha
270  VK_PPC_TPREL_HIGH, // symbol@tprel@high
271  VK_PPC_TPREL_HIGHA, // symbol@tprel@higha
272  VK_PPC_TPREL_HIGHER, // symbol@tprel@higher
273  VK_PPC_TPREL_HIGHERA, // symbol@tprel@highera
274  VK_PPC_TPREL_HIGHEST, // symbol@tprel@highest
275  VK_PPC_TPREL_HIGHESTA, // symbol@tprel@highesta
276  VK_PPC_DTPREL_LO, // symbol@dtprel@l
277  VK_PPC_DTPREL_HI, // symbol@dtprel@h
278  VK_PPC_DTPREL_HA, // symbol@dtprel@ha
279  VK_PPC_DTPREL_HIGH, // symbol@dtprel@high
280  VK_PPC_DTPREL_HIGHA, // symbol@dtprel@higha
281  VK_PPC_DTPREL_HIGHER, // symbol@dtprel@higher
282  VK_PPC_DTPREL_HIGHERA, // symbol@dtprel@highera
283  VK_PPC_DTPREL_HIGHEST, // symbol@dtprel@highest
284  VK_PPC_DTPREL_HIGHESTA, // symbol@dtprel@highesta
285  VK_PPC_GOT_TPREL, // symbol@got@tprel
286  VK_PPC_GOT_TPREL_LO, // symbol@got@tprel@l
287  VK_PPC_GOT_TPREL_HI, // symbol@got@tprel@h
288  VK_PPC_GOT_TPREL_HA, // symbol@got@tprel@ha
289  VK_PPC_GOT_DTPREL, // symbol@got@dtprel
290  VK_PPC_GOT_DTPREL_LO, // symbol@got@dtprel@l
291  VK_PPC_GOT_DTPREL_HI, // symbol@got@dtprel@h
292  VK_PPC_GOT_DTPREL_HA, // symbol@got@dtprel@ha
293  VK_PPC_TLS, // symbol@tls
294  VK_PPC_GOT_TLSGD, // symbol@got@tlsgd
295  VK_PPC_GOT_TLSGD_LO, // symbol@got@tlsgd@l
296  VK_PPC_GOT_TLSGD_HI, // symbol@got@tlsgd@h
297  VK_PPC_GOT_TLSGD_HA, // symbol@got@tlsgd@ha
298  VK_PPC_TLSGD, // symbol@tlsgd
299  VK_PPC_AIX_TLSGD, // symbol@gd
300  VK_PPC_AIX_TLSGDM, // symbol@m
301  VK_PPC_GOT_TLSLD, // symbol@got@tlsld
302  VK_PPC_GOT_TLSLD_LO, // symbol@got@tlsld@l
303  VK_PPC_GOT_TLSLD_HI, // symbol@got@tlsld@h
304  VK_PPC_GOT_TLSLD_HA, // symbol@got@tlsld@ha
305  VK_PPC_GOT_PCREL, // symbol@got@pcrel
306  VK_PPC_GOT_TLSGD_PCREL, // symbol@got@tlsgd@pcrel
307  VK_PPC_GOT_TLSLD_PCREL, // symbol@got@tlsld@pcrel
308  VK_PPC_GOT_TPREL_PCREL, // symbol@got@tprel@pcrel
309  VK_PPC_TLS_PCREL, // symbol@tls@pcrel
310  VK_PPC_TLSLD, // symbol@tlsld
311  VK_PPC_LOCAL, // symbol@local
312  VK_PPC_NOTOC, // symbol@notoc
313  VK_PPC_PCREL_OPT, // .reloc expr, R_PPC64_PCREL_OPT, expr
314 
315  VK_COFF_IMGREL32, // symbol@imgrel (image-relative)
316 
326 
327  VK_WASM_TYPEINDEX, // Reference to a symbol's type (signature)
328  VK_WASM_TLSREL, // Memory address relative to __tls_base
329  VK_WASM_MBREL, // Memory address relative to __memory_base
330  VK_WASM_TBREL, // Table index relative to __table_base
331 
332  VK_AMDGPU_GOTPCREL32_LO, // symbol@gotpcrel32@lo
333  VK_AMDGPU_GOTPCREL32_HI, // symbol@gotpcrel32@hi
334  VK_AMDGPU_REL32_LO, // symbol@rel32@lo
335  VK_AMDGPU_REL32_HI, // symbol@rel32@hi
336  VK_AMDGPU_REL64, // symbol@rel64
337  VK_AMDGPU_ABS32_LO, // symbol@abs32@lo
338  VK_AMDGPU_ABS32_HI, // symbol@abs32@hi
339 
340  VK_VE_HI32, // symbol@hi
341  VK_VE_LO32, // symbol@lo
342  VK_VE_PC_HI32, // symbol@pc_hi
343  VK_VE_PC_LO32, // symbol@pc_lo
344  VK_VE_GOT_HI32, // symbol@got_hi
345  VK_VE_GOT_LO32, // symbol@got_lo
346  VK_VE_GOTOFF_HI32, // symbol@gotoff_hi
347  VK_VE_GOTOFF_LO32, // symbol@gotoff_lo
348  VK_VE_PLT_HI32, // symbol@plt_hi
349  VK_VE_PLT_LO32, // symbol@plt_lo
350  VK_VE_TLS_GD_HI32, // symbol@tls_gd_hi
351  VK_VE_TLS_GD_LO32, // symbol@tls_gd_lo
352  VK_VE_TPOFF_HI32, // symbol@tpoff_hi
353  VK_VE_TPOFF_LO32, // symbol@tpoff_lo
354 
357  };
358 
359 private:
360  /// The symbol being referenced.
361  const MCSymbol *Symbol;
362 
363  // Subclass data stores VariantKind in bits 0..15 and HasSubsectionsViaSymbols
364  // in bit 16.
365  static const unsigned VariantKindBits = 16;
366  static const unsigned VariantKindMask = (1 << VariantKindBits) - 1;
367 
368  // FIXME: Remove this bit.
369  static const unsigned HasSubsectionsViaSymbolsBit = 1 << VariantKindBits;
370 
371  static unsigned encodeSubclassData(VariantKind Kind,
372  bool HasSubsectionsViaSymbols) {
373  return (unsigned)Kind |
374  (HasSubsectionsViaSymbols ? HasSubsectionsViaSymbolsBit : 0);
375  }
376 
377  explicit MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
378  const MCAsmInfo *MAI, SMLoc Loc = SMLoc());
379 
380 public:
381  /// \name Construction
382  /// @{
383 
384  static const MCSymbolRefExpr *create(const MCSymbol *Symbol, MCContext &Ctx) {
385  return MCSymbolRefExpr::create(Symbol, VK_None, Ctx);
386  }
387 
388  static const MCSymbolRefExpr *create(const MCSymbol *Symbol, VariantKind Kind,
389  MCContext &Ctx, SMLoc Loc = SMLoc());
390  static const MCSymbolRefExpr *create(StringRef Name, VariantKind Kind,
391  MCContext &Ctx);
392 
393  /// @}
394  /// \name Accessors
395  /// @{
396 
397  const MCSymbol &getSymbol() const { return *Symbol; }
398 
400  return (VariantKind)(getSubclassData() & VariantKindMask);
401  }
402 
404  return (getSubclassData() & HasSubsectionsViaSymbolsBit) != 0;
405  }
406 
407  /// @}
408  /// \name Static Utility Functions
409  /// @{
410 
412 
414 
415  /// @}
416 
417  static bool classof(const MCExpr *E) {
418  return E->getKind() == MCExpr::SymbolRef;
419  }
420 };
421 
422 /// Unary assembler expressions.
423 class MCUnaryExpr : public MCExpr {
424 public:
425  enum Opcode {
426  LNot, ///< Logical negation.
427  Minus, ///< Unary minus.
428  Not, ///< Bitwise negation.
429  Plus ///< Unary plus.
430  };
431 
432 private:
433  const MCExpr *Expr;
434 
435  MCUnaryExpr(Opcode Op, const MCExpr *Expr, SMLoc Loc)
436  : MCExpr(MCExpr::Unary, Loc, Op), Expr(Expr) {}
437 
438 public:
439  /// \name Construction
440  /// @{
441 
442  static const MCUnaryExpr *create(Opcode Op, const MCExpr *Expr,
443  MCContext &Ctx, SMLoc Loc = SMLoc());
444 
445  static const MCUnaryExpr *createLNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
446  return create(LNot, Expr, Ctx, Loc);
447  }
448 
449  static const MCUnaryExpr *createMinus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
450  return create(Minus, Expr, Ctx, Loc);
451  }
452 
453  static const MCUnaryExpr *createNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
454  return create(Not, Expr, Ctx, Loc);
455  }
456 
457  static const MCUnaryExpr *createPlus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
458  return create(Plus, Expr, Ctx, Loc);
459  }
460 
461  /// @}
462  /// \name Accessors
463  /// @{
464 
465  /// Get the kind of this unary expression.
466  Opcode getOpcode() const { return (Opcode)getSubclassData(); }
467 
468  /// Get the child of this unary expression.
469  const MCExpr *getSubExpr() const { return Expr; }
470 
471  /// @}
472 
473  static bool classof(const MCExpr *E) {
474  return E->getKind() == MCExpr::Unary;
475  }
476 };
477 
478 /// Binary assembler expressions.
479 class MCBinaryExpr : public MCExpr {
480 public:
481  enum Opcode {
482  Add, ///< Addition.
483  And, ///< Bitwise and.
484  Div, ///< Signed division.
485  EQ, ///< Equality comparison.
486  GT, ///< Signed greater than comparison (result is either 0 or some
487  ///< target-specific non-zero value)
488  GTE, ///< Signed greater than or equal comparison (result is either 0 or
489  ///< some target-specific non-zero value).
490  LAnd, ///< Logical and.
491  LOr, ///< Logical or.
492  LT, ///< Signed less than comparison (result is either 0 or
493  ///< some target-specific non-zero value).
494  LTE, ///< Signed less than or equal comparison (result is either 0 or
495  ///< some target-specific non-zero value).
496  Mod, ///< Signed remainder.
497  Mul, ///< Multiplication.
498  NE, ///< Inequality comparison.
499  Or, ///< Bitwise or.
500  OrNot, ///< Bitwise or not.
501  Shl, ///< Shift left.
502  AShr, ///< Arithmetic shift right.
503  LShr, ///< Logical shift right.
504  Sub, ///< Subtraction.
505  Xor ///< Bitwise exclusive or.
506  };
507 
508 private:
509  const MCExpr *LHS, *RHS;
510 
511  MCBinaryExpr(Opcode Op, const MCExpr *LHS, const MCExpr *RHS,
512  SMLoc Loc = SMLoc())
513  : MCExpr(MCExpr::Binary, Loc, Op), LHS(LHS), RHS(RHS) {}
514 
515 public:
516  /// \name Construction
517  /// @{
518 
519  static const MCBinaryExpr *create(Opcode Op, const MCExpr *LHS,
520  const MCExpr *RHS, MCContext &Ctx,
521  SMLoc Loc = SMLoc());
522 
523  static const MCBinaryExpr *createAdd(const MCExpr *LHS, const MCExpr *RHS,
524  MCContext &Ctx) {
525  return create(Add, LHS, RHS, Ctx);
526  }
527 
528  static const MCBinaryExpr *createAnd(const MCExpr *LHS, const MCExpr *RHS,
529  MCContext &Ctx) {
530  return create(And, LHS, RHS, Ctx);
531  }
532 
533  static const MCBinaryExpr *createDiv(const MCExpr *LHS, const MCExpr *RHS,
534  MCContext &Ctx) {
535  return create(Div, LHS, RHS, Ctx);
536  }
537 
538  static const MCBinaryExpr *createEQ(const MCExpr *LHS, const MCExpr *RHS,
539  MCContext &Ctx) {
540  return create(EQ, LHS, RHS, Ctx);
541  }
542 
543  static const MCBinaryExpr *createGT(const MCExpr *LHS, const MCExpr *RHS,
544  MCContext &Ctx) {
545  return create(GT, LHS, RHS, Ctx);
546  }
547 
548  static const MCBinaryExpr *createGTE(const MCExpr *LHS, const MCExpr *RHS,
549  MCContext &Ctx) {
550  return create(GTE, LHS, RHS, Ctx);
551  }
552 
553  static const MCBinaryExpr *createLAnd(const MCExpr *LHS, const MCExpr *RHS,
554  MCContext &Ctx) {
555  return create(LAnd, LHS, RHS, Ctx);
556  }
557 
558  static const MCBinaryExpr *createLOr(const MCExpr *LHS, const MCExpr *RHS,
559  MCContext &Ctx) {
560  return create(LOr, LHS, RHS, Ctx);
561  }
562 
563  static const MCBinaryExpr *createLT(const MCExpr *LHS, const MCExpr *RHS,
564  MCContext &Ctx) {
565  return create(LT, LHS, RHS, Ctx);
566  }
567 
568  static const MCBinaryExpr *createLTE(const MCExpr *LHS, const MCExpr *RHS,
569  MCContext &Ctx) {
570  return create(LTE, LHS, RHS, Ctx);
571  }
572 
573  static const MCBinaryExpr *createMod(const MCExpr *LHS, const MCExpr *RHS,
574  MCContext &Ctx) {
575  return create(Mod, LHS, RHS, Ctx);
576  }
577 
578  static const MCBinaryExpr *createMul(const MCExpr *LHS, const MCExpr *RHS,
579  MCContext &Ctx) {
580  return create(Mul, LHS, RHS, Ctx);
581  }
582 
583  static const MCBinaryExpr *createNE(const MCExpr *LHS, const MCExpr *RHS,
584  MCContext &Ctx) {
585  return create(NE, LHS, RHS, Ctx);
586  }
587 
588  static const MCBinaryExpr *createOr(const MCExpr *LHS, const MCExpr *RHS,
589  MCContext &Ctx) {
590  return create(Or, LHS, RHS, Ctx);
591  }
592 
593  static const MCBinaryExpr *createShl(const MCExpr *LHS, const MCExpr *RHS,
594  MCContext &Ctx) {
595  return create(Shl, LHS, RHS, Ctx);
596  }
597 
598  static const MCBinaryExpr *createAShr(const MCExpr *LHS, const MCExpr *RHS,
599  MCContext &Ctx) {
600  return create(AShr, LHS, RHS, Ctx);
601  }
602 
603  static const MCBinaryExpr *createLShr(const MCExpr *LHS, const MCExpr *RHS,
604  MCContext &Ctx) {
605  return create(LShr, LHS, RHS, Ctx);
606  }
607 
608  static const MCBinaryExpr *createSub(const MCExpr *LHS, const MCExpr *RHS,
609  MCContext &Ctx) {
610  return create(Sub, LHS, RHS, Ctx);
611  }
612 
613  static const MCBinaryExpr *createXor(const MCExpr *LHS, const MCExpr *RHS,
614  MCContext &Ctx) {
615  return create(Xor, LHS, RHS, Ctx);
616  }
617 
618  /// @}
619  /// \name Accessors
620  /// @{
621 
622  /// Get the kind of this binary expression.
623  Opcode getOpcode() const { return (Opcode)getSubclassData(); }
624 
625  /// Get the left-hand side expression of the binary operator.
626  const MCExpr *getLHS() const { return LHS; }
627 
628  /// Get the right-hand side expression of the binary operator.
629  const MCExpr *getRHS() const { return RHS; }
630 
631  /// @}
632 
633  static bool classof(const MCExpr *E) {
634  return E->getKind() == MCExpr::Binary;
635  }
636 };
637 
638 /// This is an extension point for target-specific MCExpr subclasses to
639 /// implement.
640 ///
641 /// NOTE: All subclasses are required to have trivial destructors because
642 /// MCExprs are bump pointer allocated and not destructed.
643 class MCTargetExpr : public MCExpr {
644  virtual void anchor();
645 
646 protected:
648  virtual ~MCTargetExpr() = default;
649 
650 public:
651  virtual void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const = 0;
652  virtual bool evaluateAsRelocatableImpl(MCValue &Res,
653  const MCAsmLayout *Layout,
654  const MCFixup *Fixup) const = 0;
655  // allow Target Expressions to be checked for equality
656  virtual bool isEqualTo(const MCExpr *x) const { return false; }
657  // This should be set when assigned expressions are not valid ".set"
658  // expressions, e.g. registers, and must be inlined.
659  virtual bool inlineAssignedExpr() const { return false; }
660  virtual void visitUsedExpr(MCStreamer& Streamer) const = 0;
661  virtual MCFragment *findAssociatedFragment() const = 0;
662 
663  virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const = 0;
664 
665  static bool classof(const MCExpr *E) {
666  return E->getKind() == MCExpr::Target;
667  }
668 };
669 
670 } // end namespace llvm
671 
672 #endif // LLVM_MC_MCEXPR_H
llvm::MCTargetExpr::evaluateAsRelocatableImpl
virtual bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const =0
llvm::MCSymbolRefExpr::getKind
VariantKind getKind() const
Definition: MCExpr.h:399
llvm::MCSymbolRefExpr::VK_AVR_HI8
@ VK_AVR_HI8
Definition: MCExpr.h:240
llvm::MCExpr::operator=
MCExpr & operator=(const MCExpr &)=delete
llvm::MCBinaryExpr::createDiv
static const MCBinaryExpr * createDiv(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:533
llvm::MCSymbolRefExpr::VK_PPC_AIX_TLSGDM
@ VK_PPC_AIX_TLSGDM
Definition: MCExpr.h:300
llvm::MCSymbolRefExpr::VK_PPC_TOC_HA
@ VK_PPC_TOC_HA
Definition: MCExpr.h:263
llvm::MCSymbolRefExpr::VK_ARM_TLSDESCSEQ
@ VK_ARM_TLSDESCSEQ
Definition: MCExpr.h:236
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::MCSymbolRefExpr::VK_PPC_HIGHESTA
@ VK_PPC_HIGHESTA
Definition: MCExpr.h:255
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCExpr::evaluateAsValue
bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables.
Definition: MCExpr.cpp:753
llvm::MCSymbolRefExpr::VK_PAGEOFF
@ VK_PAGEOFF
Definition: MCExpr.h:219
llvm::MCSymbolRefExpr::VK_GOT
@ VK_GOT
Definition: MCExpr.h:198
llvm::MCSymbolRefExpr::VK_X86_PLTOFF
@ VK_X86_PLTOFF
Definition: MCExpr.h:227
llvm::MCUnaryExpr::getOpcode
Opcode getOpcode() const
Get the kind of this unary expression.
Definition: MCExpr.h:466
llvm::MCSymbolRefExpr::VK_Hexagon_LD_PLT
@ VK_Hexagon_LD_PLT
Definition: MCExpr.h:323
llvm::MCSymbolRefExpr::VK_AVR_NONE
@ VK_AVR_NONE
Definition: MCExpr.h:238
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HA
@ VK_PPC_TPREL_HA
Definition: MCExpr.h:269
llvm::MCBinaryExpr::LT
@ LT
Signed less than comparison (result is either 0 or some target-specific non-zero value).
Definition: MCExpr.h:492
llvm::MCSymbolRefExpr::VK_ARM_GOT_PREL
@ VK_ARM_GOT_PREL
Definition: MCExpr.h:230
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHER
@ VK_PPC_DTPREL_HIGHER
Definition: MCExpr.h:281
llvm::MCBinaryExpr::Opcode
Opcode
Definition: MCExpr.h:481
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHEST
@ VK_PPC_DTPREL_HIGHEST
Definition: MCExpr.h:283
llvm::MCSymbolRefExpr::VK_PPC_TLSGD
@ VK_PPC_TLSGD
Definition: MCExpr.h:298
llvm::MCSymbolRefExpr::VK_INDNTPOFF
@ VK_INDNTPOFF
Definition: MCExpr.h:204
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
llvm::MCSymbolRefExpr::VK_AMDGPU_REL32_HI
@ VK_AMDGPU_REL32_HI
Definition: MCExpr.h:335
llvm::MCSymbolRefExpr::VK_AVR_DIFF8
@ VK_AVR_DIFF8
Definition: MCExpr.h:242
llvm::MCSymbolRefExpr::VK_VE_TLS_GD_LO32
@ VK_VE_TLS_GD_LO32
Definition: MCExpr.h:351
llvm::MCSymbolRefExpr::VK_PPC_HIGHA
@ VK_PPC_HIGHA
Definition: MCExpr.h:251
llvm::MCConstantExpr::create
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:194
llvm::MCUnaryExpr::createNot
static const MCUnaryExpr * createNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.h:453
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_HI
@ VK_PPC_GOT_TPREL_HI
Definition: MCExpr.h:287
llvm::MCSymbolRefExpr::VK_ARM_TARGET1
@ VK_ARM_TARGET1
Definition: MCExpr.h:231
llvm::MCSymbolRefExpr::VK_VE_GOTOFF_LO32
@ VK_VE_GOTOFF_LO32
Definition: MCExpr.h:347
llvm::MCUnaryExpr::createMinus
static const MCUnaryExpr * createMinus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.h:449
llvm::MCSymbolRefExpr::VK_ARM_SBREL
@ VK_ARM_SBREL
Definition: MCExpr.h:234
llvm::MCBinaryExpr::EQ
@ EQ
Equality comparison.
Definition: MCExpr.h:485
llvm::MCSymbolRefExpr::VK_Hexagon_GD_PLT
@ VK_Hexagon_GD_PLT
Definition: MCExpr.h:322
llvm::MCSymbolRefExpr::VK_GOTREL
@ VK_GOTREL
Definition: MCExpr.h:200
llvm::MCUnaryExpr::Plus
@ Plus
Unary plus.
Definition: MCExpr.h:429
llvm::MCBinaryExpr::createAnd
static const MCBinaryExpr * createAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:528
llvm::MCBinaryExpr::Add
@ Add
Addition.
Definition: MCExpr.h:482
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HI
@ VK_PPC_GOT_TLSGD_HI
Definition: MCExpr.h:296
llvm::MCSymbolRefExpr::VK_PPC_PCREL_OPT
@ VK_PPC_PCREL_OPT
Definition: MCExpr.h:313
llvm::MCSymbolRefExpr::getVariantKindForName
static VariantKind getVariantKindForName(StringRef Name)
Definition: MCExpr.cpp:387
llvm::MCBinaryExpr::Mul
@ Mul
Multiplication.
Definition: MCExpr.h:497
llvm::MCSymbolRefExpr::VK_PPC_TOC_HI
@ VK_PPC_TOC_HI
Definition: MCExpr.h:262
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HI
@ VK_PPC_DTPREL_HI
Definition: MCExpr.h:277
DenseMap.h
llvm::MCSymbolRefExpr::VK_ARM_TARGET2
@ VK_ARM_TARGET2
Definition: MCExpr.h:232
llvm::MCSymbolRefExpr::VK_PPC_GOT_HA
@ VK_PPC_GOT_HA
Definition: MCExpr.h:258
llvm::MCConstantExpr::classof
static bool classof(const MCExpr *E)
Definition: MCExpr.h:182
llvm::MCBinaryExpr::AShr
@ AShr
Arithmetic shift right.
Definition: MCExpr.h:502
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_LO
@ VK_PPC_GOT_TLSGD_LO
Definition: MCExpr.h:295
llvm::MCSymbolRefExpr::VK_SIZE
@ VK_SIZE
Definition: MCExpr.h:223
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHESTA
@ VK_PPC_DTPREL_HIGHESTA
Definition: MCExpr.h:284
llvm::MCSymbolRefExpr::VK_PPC_GOT_PCREL
@ VK_PPC_GOT_PCREL
Definition: MCExpr.h:305
llvm::MCSymbolRefExpr::VK_GOTOFF
@ VK_GOTOFF
Definition: MCExpr.h:199
llvm::MCBinaryExpr
Binary assembler expressions.
Definition: MCExpr.h:479
llvm::MCBinaryExpr::And
@ And
Bitwise and.
Definition: MCExpr.h:483
llvm::MCSymbolRefExpr::VK_Hexagon_GD_GOT
@ VK_Hexagon_GD_GOT
Definition: MCExpr.h:320
llvm::MCUnaryExpr
Unary assembler expressions.
Definition: MCExpr.h:423
llvm::MCSymbolRefExpr::VK_VE_TLS_GD_HI32
@ VK_VE_TLS_GD_HI32
Definition: MCExpr.h:350
llvm::MCSymbolRefExpr::VK_VE_HI32
@ VK_VE_HI32
Definition: MCExpr.h:340
llvm::MCSymbolRefExpr::VK_PPC_L
@ VK_PPC_L
Definition: MCExpr.h:265
llvm::MCExpr::evaluateAsRelocatable
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
Definition: MCExpr.cpp:745
llvm::MCSymbolRefExpr::VK_WASM_MBREL
@ VK_WASM_MBREL
Definition: MCExpr.h:329
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHA
@ VK_PPC_TPREL_HIGHA
Definition: MCExpr.h:271
llvm::MCSymbolRefExpr::VK_PPC_TLS
@ VK_PPC_TLS
Definition: MCExpr.h:293
llvm::MCFragment
Definition: MCFragment.h:31
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:197
llvm::MCSymbolRefExpr::VK_NTPOFF
@ VK_NTPOFF
Definition: MCExpr.h:205
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_PCREL
@ VK_PPC_GOT_TLSGD_PCREL
Definition: MCExpr.h:306
llvm::MCBinaryExpr::LOr
@ LOr
Logical or.
Definition: MCExpr.h:491
llvm::MCBinaryExpr::createAShr
static const MCBinaryExpr * createAShr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:598
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL_LO
@ VK_PPC_GOT_DTPREL_LO
Definition: MCExpr.h:290
llvm::MCSymbolRefExpr::VK_WASM_TBREL
@ VK_WASM_TBREL
Definition: MCExpr.h:330
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
llvm::MCSymbolRefExpr::classof
static bool classof(const MCExpr *E)
Definition: MCExpr.h:417
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHEST
@ VK_PPC_TPREL_HIGHEST
Definition: MCExpr.h:274
llvm::MCSymbolRefExpr::VK_PPC_TOC
@ VK_PPC_TOC
Definition: MCExpr.h:260
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MCSymbolRefExpr::VK_AVR_HLO8
@ VK_AVR_HLO8
Definition: MCExpr.h:241
llvm::MCExpr::Target
@ Target
Target specific expression.
Definition: MCExpr.h:42
llvm::MCSymbolRefExpr::VK_GOTPAGEOFF
@ VK_GOTPAGEOFF
Definition: MCExpr.h:221
llvm::MCBinaryExpr::createMul
static const MCBinaryExpr * createMul(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:578
llvm::MCSymbolRefExpr::VK_Hexagon_LO16
@ VK_Hexagon_LO16
Definition: MCExpr.h:317
llvm::MCSymbolRefExpr::VK_AMDGPU_GOTPCREL32_LO
@ VK_AMDGPU_GOTPCREL32_LO
Definition: MCExpr.h:332
llvm::MCBinaryExpr::Or
@ Or
Bitwise or.
Definition: MCExpr.h:499
llvm::MCSymbolRefExpr::VK_GOTNTPOFF
@ VK_GOTNTPOFF
Definition: MCExpr.h:206
llvm::MCSymbolRefExpr::VK_DTPREL
@ VK_DTPREL
Definition: MCExpr.h:356
llvm::MCSymbolRefExpr::VK_PPC_U
@ VK_PPC_U
Definition: MCExpr.h:264
llvm::MCSymbolRefExpr::VK_TLSLDM
@ VK_TLSLDM
Definition: MCExpr.h:210
llvm::MCSymbolRefExpr::VK_AMDGPU_REL64
@ VK_AMDGPU_REL64
Definition: MCExpr.h:336
llvm::MCBinaryExpr::getRHS
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
Definition: MCExpr.h:629
llvm::MCConstantExpr::getValue
int64_t getValue() const
Definition: MCExpr.h:173
llvm::MCUnaryExpr::create
static const MCUnaryExpr * create(Opcode Op, const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.cpp:189
llvm::MCTargetExpr::fixELFSymbolsInTLSFixups
virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const =0
llvm::MCSymbolRefExpr::VK_AMDGPU_REL32_LO
@ VK_AMDGPU_REL32_LO
Definition: MCExpr.h:334
SMLoc.h
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::MCSymbolRefExpr::VK_PPC_NOTOC
@ VK_PPC_NOTOC
Definition: MCExpr.h:312
llvm::MCExpr::getSubclassData
unsigned getSubclassData() const
Definition: MCExpr.h:72
llvm::MCSymbolRefExpr::getSymbol
const MCSymbol & getSymbol() const
Definition: MCExpr.h:397
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::MCBinaryExpr::Mod
@ Mod
Signed remainder.
Definition: MCExpr.h:496
llvm::MCConstantExpr::useHexFormat
bool useHexFormat() const
Definition: MCExpr.h:178
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHERA
@ VK_PPC_DTPREL_HIGHERA
Definition: MCExpr.h:282
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HA
@ VK_PPC_GOT_DTPREL_HA
Definition: MCExpr.h:292
llvm::MCSymbolRefExpr::VK_AVR_DIFF32
@ VK_AVR_DIFF32
Definition: MCExpr.h:244
llvm::MCExpr::evaluateKnownAbsolute
bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const
Definition: MCExpr.cpp:557
llvm::MCSymbolRefExpr::VK_TLSLD
@ VK_TLSLD
Definition: MCExpr.h:209
llvm::MCConstantExpr::getSizeInBytes
unsigned getSizeInBytes() const
Definition: MCExpr.h:174
llvm::MCExpr::getKind
ExprKind getKind() const
Definition: MCExpr.h:81
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HI
@ VK_PPC_TPREL_HI
Definition: MCExpr.h:268
llvm::MCSymbolRefExpr::VK_PPC_HA
@ VK_PPC_HA
Definition: MCExpr.h:249
llvm::MCUnaryExpr::Minus
@ Minus
Unary minus.
Definition: MCExpr.h:427
llvm::MCSymbolRefExpr::VK_PPC_LOCAL
@ VK_PPC_LOCAL
Definition: MCExpr.h:311
llvm::MCExpr::Binary
@ Binary
Binary expressions.
Definition: MCExpr.h:38
llvm::MCBinaryExpr::createShl
static const MCBinaryExpr * createShl(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:593
llvm::MCBinaryExpr::createLOr
static const MCBinaryExpr * createLOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:558
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_PCREL
@ VK_PPC_GOT_TPREL_PCREL
Definition: MCExpr.h:308
llvm::MCSymbolRefExpr::VK_PPC_HI
@ VK_PPC_HI
Definition: MCExpr.h:248
llvm::MCConstantExpr
Definition: MCExpr.h:144
llvm::MCTargetExpr::classof
static bool classof(const MCExpr *E)
Definition: MCExpr.h:665
llvm::MCSymbolRefExpr::VK_PPC_GOT_HI
@ VK_PPC_GOT_HI
Definition: MCExpr.h:257
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HI
@ VK_PPC_GOT_DTPREL_HI
Definition: MCExpr.h:291
llvm::MCSymbolRefExpr::VK_AMDGPU_GOTPCREL32_HI
@ VK_AMDGPU_GOTPCREL32_HI
Definition: MCExpr.h:333
llvm::MCSymbolRefExpr::VK_PPC_TLSLD
@ VK_PPC_TLSLD
Definition: MCExpr.h:310
llvm::MCSymbolRefExpr::VK_Hexagon_HI16
@ VK_Hexagon_HI16
Definition: MCExpr.h:318
llvm::MCSymbolRefExpr::VK_AMDGPU_ABS32_HI
@ VK_AMDGPU_ABS32_HI
Definition: MCExpr.h:338
llvm::MCAssembler
Definition: MCAssembler.h:60
llvm::MCSymbolRefExpr::VK_AVR_LO8
@ VK_AVR_LO8
Definition: MCExpr.h:239
llvm::MCSymbolRefExpr::VariantKind
VariantKind
Definition: MCExpr.h:194
llvm::MCBinaryExpr::createNE
static const MCBinaryExpr * createNE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:583
llvm::MCBinaryExpr::createOr
static const MCBinaryExpr * createOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:588
llvm::MCSymbolRefExpr::VK_ARM_PREL31
@ VK_ARM_PREL31
Definition: MCExpr.h:233
llvm::MCBinaryExpr::classof
static bool classof(const MCExpr *E)
Definition: MCExpr.h:633
llvm::MCSymbolRefExpr::VK_PPC_TLS_PCREL
@ VK_PPC_TLS_PCREL
Definition: MCExpr.h:309
llvm::MCSymbolRefExpr::VK_PPC_TOC_LO
@ VK_PPC_TOC_LO
Definition: MCExpr.h:261
llvm::MCExpr::MCExpr
MCExpr(ExprKind Kind, SMLoc Loc, unsigned SubclassData=0)
Definition: MCExpr.h:61
llvm::MCSymbolRefExpr::VK_WASM_TLSREL
@ VK_WASM_TLSREL
Definition: MCExpr.h:328
llvm::MCBinaryExpr::Div
@ Div
Signed division.
Definition: MCExpr.h:484
llvm::MCSymbolRefExpr::VK_Invalid
@ VK_Invalid
Definition: MCExpr.h:196
llvm::MCSymbolRefExpr::VK_PLT
@ VK_PLT
Definition: MCExpr.h:207
llvm::DenseMap< const MCSection *, uint64_t >
llvm::MCSymbolRefExpr::VK_TLSDESC
@ VK_TLSDESC
Definition: MCExpr.h:214
llvm::MCBinaryExpr::createLT
static const MCBinaryExpr * createLT(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:563
llvm::MCSymbolRefExpr::VK_TLVP
@ VK_TLVP
Definition: MCExpr.h:215
llvm::MCExpr::evaluateAsRelocatableImpl
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const
Definition: MCExpr.cpp:772
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD
@ VK_PPC_GOT_TLSGD
Definition: MCExpr.h:294
llvm::MCSymbolRefExpr::VK_VE_GOT_HI32
@ VK_VE_GOT_HI32
Definition: MCExpr.h:344
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL
@ VK_PPC_GOT_TPREL
Definition: MCExpr.h:285
llvm::MCBinaryExpr::GTE
@ GTE
Signed greater than or equal comparison (result is either 0 or some target-specific non-zero value).
Definition: MCExpr.h:488
llvm::MCBinaryExpr::create
static const MCBinaryExpr * create(Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.cpp:183
llvm::MCSymbolRefExpr::VK_PCREL
@ VK_PCREL
Definition: MCExpr.h:201
llvm::MCBinaryExpr::Shl
@ Shl
Shift left.
Definition: MCExpr.h:501
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGH
@ VK_PPC_TPREL_HIGH
Definition: MCExpr.h:270
llvm::MCSymbolRefExpr::VK_PPC_HIGHEST
@ VK_PPC_HIGHEST
Definition: MCExpr.h:254
llvm::MCTargetExpr::inlineAssignedExpr
virtual bool inlineAssignedExpr() const
Definition: MCExpr.h:659
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCSymbolRefExpr::VK_TLSCALL
@ VK_TLSCALL
Definition: MCExpr.h:213
llvm::MCBinaryExpr::createSub
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:608
llvm::MCSymbolRefExpr::VK_PPC_TPREL_LO
@ VK_PPC_TPREL_LO
Definition: MCExpr.h:267
llvm::MCBinaryExpr::LAnd
@ LAnd
Logical and.
Definition: MCExpr.h:490
llvm::MCBinaryExpr::createLShr
static const MCBinaryExpr * createLShr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:603
llvm::MCSymbolRefExpr::VK_ARM_TLSLDO
@ VK_ARM_TLSLDO
Definition: MCExpr.h:235
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL
@ VK_PPC_GOT_DTPREL
Definition: MCExpr.h:289
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
llvm::MCBinaryExpr::NE
@ NE
Inequality comparison.
Definition: MCExpr.h:498
llvm::MCSymbolRefExpr::VK_TPOFF
@ VK_TPOFF
Definition: MCExpr.h:211
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_LO
@ VK_PPC_DTPREL_LO
Definition: MCExpr.h:276
llvm::MCSymbolRefExpr::VK_X86_ABS8
@ VK_X86_ABS8
Definition: MCExpr.h:226
llvm::MCBinaryExpr::createAdd
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:523
llvm::MCSymbolRefExpr::VK_AVR_PM
@ VK_AVR_PM
Definition: MCExpr.h:245
llvm::MCBinaryExpr::GT
@ GT
Signed greater than comparison (result is either 0 or some target-specific non-zero value)
Definition: MCExpr.h:486
llvm::MCSymbolRefExpr::VK_PPC_TOCBASE
@ VK_PPC_TOCBASE
Definition: MCExpr.h:259
llvm::MCUnaryExpr::getSubExpr
const MCExpr * getSubExpr() const
Get the child of this unary expression.
Definition: MCExpr.h:469
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::MCBinaryExpr::createMod
static const MCBinaryExpr * createMod(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:573
llvm::MCTargetExpr::~MCTargetExpr
virtual ~MCTargetExpr()=default
llvm::MCUnaryExpr::createLNot
static const MCUnaryExpr * createLNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.h:445
llvm::MCSymbolRefExpr::VK_GOTPCREL
@ VK_GOTPCREL
Definition: MCExpr.h:202
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_LO
@ VK_PPC_GOT_TLSLD_LO
Definition: MCExpr.h:302
llvm::MCBinaryExpr::createLTE
static const MCBinaryExpr * createLTE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:568
llvm::MCExpr::dump
void dump() const
Definition: MCExpr.cpp:175
llvm::MCSymbolRefExpr::VK_PPC_HIGH
@ VK_PPC_HIGH
Definition: MCExpr.h:250
llvm::MCSymbolRefExpr::VK_WEAKREF
@ VK_WEAKREF
Definition: MCExpr.h:224
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHER
@ VK_PPC_TPREL_HIGHER
Definition: MCExpr.h:272
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHESTA
@ VK_PPC_TPREL_HIGHESTA
Definition: MCExpr.h:275
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO
@ VK_PPC_GOT_TPREL_LO
Definition: MCExpr.h:286
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HI
@ VK_PPC_GOT_TLSLD_HI
Definition: MCExpr.h:303
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HA
@ VK_PPC_GOT_TLSGD_HA
Definition: MCExpr.h:297
llvm::MCUnaryExpr::Opcode
Opcode
Definition: MCExpr.h:425
llvm::MCBinaryExpr::createLAnd
static const MCBinaryExpr * createLAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:553
llvm::MCSymbolRefExpr::VK_TPREL
@ VK_TPREL
Definition: MCExpr.h:355
llvm::MCBinaryExpr::getOpcode
Opcode getOpcode() const
Get the kind of this binary expression.
Definition: MCExpr.h:623
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGH
@ VK_PPC_DTPREL_HIGH
Definition: MCExpr.h:279
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHERA
@ VK_PPC_TPREL_HIGHERA
Definition: MCExpr.h:273
llvm::MCSymbolRefExpr::VK_PPC_GOT_LO
@ VK_PPC_GOT_LO
Definition: MCExpr.h:256
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::MCTargetExpr::printImpl
virtual void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const =0
uint16_t
llvm::MCAsmLayout
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:314
llvm::MCBinaryExpr::Sub
@ Sub
Subtraction.
Definition: MCExpr.h:504
llvm::MCSymbolRefExpr::VK_VE_TPOFF_HI32
@ VK_VE_TPOFF_HI32
Definition: MCExpr.h:352
llvm::MCTargetExpr::visitUsedExpr
virtual void visitUsedExpr(MCStreamer &Streamer) const =0
llvm::MCSymbolRefExpr::VK_TLVPPAGE
@ VK_TLVPPAGE
Definition: MCExpr.h:216
llvm::MCUnaryExpr::LNot
@ LNot
Logical negation.
Definition: MCExpr.h:426
llvm::MCSymbolRefExpr::VK_VE_LO32
@ VK_VE_LO32
Definition: MCExpr.h:341
llvm::MCBinaryExpr::Xor
@ Xor
Bitwise exclusive or.
Definition: MCExpr.h:505
llvm::MCSymbolRefExpr::VK_Hexagon_IE_GOT
@ VK_Hexagon_IE_GOT
Definition: MCExpr.h:325
llvm::MCSymbolRefExpr::VK_WASM_TYPEINDEX
@ VK_WASM_TYPEINDEX
Definition: MCExpr.h:327
x
TODO unsigned x
Definition: README.txt:10
llvm::MCSymbolRefExpr::VK_VE_GOT_LO32
@ VK_VE_GOT_LO32
Definition: MCExpr.h:345
llvm::MCUnaryExpr::classof
static bool classof(const MCExpr *E)
Definition: MCExpr.h:473
llvm::MCSymbolRefExpr::VK_TLSGD
@ VK_TLSGD
Definition: MCExpr.h:208
llvm::MCSymbolRefExpr::VK_COFF_IMGREL32
@ VK_COFF_IMGREL32
Definition: MCExpr.h:315
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:384
llvm::MCSymbolRefExpr::VK_PPC_HIGHER
@ VK_PPC_HIGHER
Definition: MCExpr.h:252
llvm::MCSymbolRefExpr::getVariantKindName
static StringRef getVariantKindName(VariantKind Kind)
Definition: MCExpr.cpp:221
llvm::MCSymbolRefExpr::VK_VE_PLT_HI32
@ VK_VE_PLT_HI32
Definition: MCExpr.h:348
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_HA
@ VK_PPC_GOT_TPREL_HA
Definition: MCExpr.h:288
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_PCREL
@ VK_PPC_GOT_TLSLD_PCREL
Definition: MCExpr.h:307
llvm::MCSymbolRefExpr::VK_Hexagon_GPREL
@ VK_Hexagon_GPREL
Definition: MCExpr.h:319
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HA
@ VK_PPC_DTPREL_HA
Definition: MCExpr.h:278
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD
@ VK_PPC_GOT_TLSLD
Definition: MCExpr.h:301
llvm::MCSymbolRefExpr::hasSubsectionsViaSymbols
bool hasSubsectionsViaSymbols() const
Definition: MCExpr.h:403
llvm::MCExpr::print
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Definition: MCExpr.cpp:42
llvm::MCBinaryExpr::OrNot
@ OrNot
Bitwise or not.
Definition: MCExpr.h:500
llvm::MCExpr::SymbolRef
@ SymbolRef
References to labels and assigned expressions.
Definition: MCExpr.h:40
llvm::MCSymbolRefExpr::VK_VE_GOTOFF_HI32
@ VK_VE_GOTOFF_HI32
Definition: MCExpr.h:346
llvm::MCSymbolRefExpr::VK_VE_TPOFF_LO32
@ VK_VE_TPOFF_LO32
Definition: MCExpr.h:353
llvm::MCSymbolRefExpr::VK_VE_PC_HI32
@ VK_VE_PC_HI32
Definition: MCExpr.h:342
llvm::MCExpr::Unary
@ Unary
Unary expressions.
Definition: MCExpr.h:41
llvm::MCSymbolRefExpr::VK_AVR_DIFF16
@ VK_AVR_DIFF16
Definition: MCExpr.h:243
llvm::MCSymbolRefExpr::VK_PPC_LO
@ VK_PPC_LO
Definition: MCExpr.h:247
llvm::MCSymbolRefExpr::VK_VE_PC_LO32
@ VK_VE_PC_LO32
Definition: MCExpr.h:343
llvm::MCExpr::Constant
@ Constant
Constant expressions.
Definition: MCExpr.h:39
llvm::MCExpr::findAssociatedFragment
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Definition: MCExpr.cpp:983
llvm::MCBinaryExpr::createEQ
static const MCBinaryExpr * createEQ(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:538
llvm::MCSymbolRefExpr::VK_VE_PLT_LO32
@ VK_VE_PLT_LO32
Definition: MCExpr.h:349
llvm::MCBinaryExpr::createGT
static const MCBinaryExpr * createGT(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:543
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HA
@ VK_PPC_GOT_TLSLD_HA
Definition: MCExpr.h:304
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
llvm::MCValue
This represents an "assembler immediate".
Definition: MCValue.h:37
llvm::MCBinaryExpr::LTE
@ LTE
Signed less than or equal comparison (result is either 0 or some target-specific non-zero value).
Definition: MCExpr.h:494
llvm::MCSymbolRefExpr::VK_None
@ VK_None
Definition: MCExpr.h:195
llvm::MCSymbolRefExpr::VK_GOTPAGE
@ VK_GOTPAGE
Definition: MCExpr.h:220
llvm::MCBinaryExpr::LShr
@ LShr
Logical shift right.
Definition: MCExpr.h:503
llvm::MCExpr::ExprKind
ExprKind
Definition: MCExpr.h:37
llvm::MCTargetExpr::isEqualTo
virtual bool isEqualTo(const MCExpr *x) const
Definition: MCExpr.h:656
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHA
@ VK_PPC_DTPREL_HIGHA
Definition: MCExpr.h:280
llvm::MCSymbolRefExpr::VK_PPC_HIGHERA
@ VK_PPC_HIGHERA
Definition: MCExpr.h:253
llvm::MCTargetExpr::findAssociatedFragment
virtual MCFragment * findAssociatedFragment() const =0
llvm::MCUnaryExpr::createPlus
static const MCUnaryExpr * createPlus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.h:457
llvm::MCSymbolRefExpr::VK_PAGE
@ VK_PAGE
Definition: MCExpr.h:218
llvm::MCTargetExpr
This is an extension point for target-specific MCExpr subclasses to implement.
Definition: MCExpr.h:643
llvm::MCBinaryExpr::createGTE
static const MCBinaryExpr * createGTE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:548
llvm::MCSymbolRefExpr::VK_Hexagon_IE
@ VK_Hexagon_IE
Definition: MCExpr.h:324
llvm::MCFixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:71
llvm::MCSymbolRefExpr::VK_Hexagon_LD_GOT
@ VK_Hexagon_LD_GOT
Definition: MCExpr.h:321
llvm::MCSymbolRefExpr::VK_TLVPPAGEOFF
@ VK_TLVPPAGEOFF
Definition: MCExpr.h:217
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::MCSymbolRefExpr::VK_SECREL
@ VK_SECREL
Definition: MCExpr.h:222
llvm::MCSymbolRefExpr::VK_AMDGPU_ABS32_LO
@ VK_AMDGPU_ABS32_LO
Definition: MCExpr.h:337
llvm::MCSymbolRefExpr::VK_GOTTPOFF
@ VK_GOTTPOFF
Definition: MCExpr.h:203
llvm::MCUnaryExpr::Not
@ Not
Bitwise negation.
Definition: MCExpr.h:428
llvm::MCSymbolRefExpr::VK_PPC_DTPMOD
@ VK_PPC_DTPMOD
Definition: MCExpr.h:266
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::MCBinaryExpr::createXor
static const MCBinaryExpr * createXor(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:613
llvm::MCExpr::getLoc
SMLoc getLoc() const
Definition: MCExpr.h:82
llvm::MCBinaryExpr::getLHS
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
Definition: MCExpr.h:626
llvm::MCSymbolRefExpr::VK_ARM_NONE
@ VK_ARM_NONE
Definition: MCExpr.h:229
llvm::MCSymbolRefExpr::VK_DTPOFF
@ VK_DTPOFF
Definition: MCExpr.h:212
llvm::MCTargetExpr::MCTargetExpr
MCTargetExpr()
Definition: MCExpr.h:647
llvm::MCSymbolRefExpr::VK_PPC_AIX_TLSGD
@ VK_PPC_AIX_TLSGD
Definition: MCExpr.h:299