LLVM  3.7.0
MipsMCExpr.h
Go to the documentation of this file.
1 //===-- MipsMCExpr.h - Mips specific MC expression classes ------*- 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 
10 #ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSMCEXPR_H
11 #define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSMCEXPR_H
12 
13 #include "llvm/MC/MCAsmLayout.h"
14 #include "llvm/MC/MCExpr.h"
15 #include "llvm/MC/MCValue.h"
16 
17 namespace llvm {
18 
19 class MipsMCExpr : public MCTargetExpr {
20 public:
21  enum VariantKind {
27  };
28 
29 private:
30  const VariantKind Kind;
31  const MCExpr *Expr;
32 
33  explicit MipsMCExpr(VariantKind Kind, const MCExpr *Expr)
34  : Kind(Kind), Expr(Expr) {}
35 
36 public:
38  const MCBinaryExpr *BE);
39 
40  static const MipsMCExpr *create(MCSymbolRefExpr::VariantKind VK,
41  const MCExpr *Expr, MCContext &Ctx);
42 
43  /// getOpcode - Get the kind of this expression.
44  VariantKind getKind() const { return Kind; }
45 
46  /// getSubExpr - Get the child of this expression.
47  const MCExpr *getSubExpr() const { return Expr; }
48 
49  void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
51  const MCAsmLayout *Layout,
52  const MCFixup *Fixup) const override;
53  void visitUsedExpr(MCStreamer &Streamer) const override;
54  MCSection *findAssociatedSection() const override {
56  }
57 
58  // There are no TLS MipsMCExprs at the moment.
59  void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override {}
60 
61  static bool classof(const MCExpr *E) {
62  return E->getKind() == MCExpr::Target;
63  }
64 };
65 } // end namespace llvm
66 
67 #endif
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
Definition: MipsMCExpr.cpp:82
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
Definition: MipsMCExpr.h:47
This represents an "assembler immediate".
Definition: MCValue.h:44
ExprKind getKind() const
Definition: MCExpr.h:69
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:62
MCSection * findAssociatedSection() const override
Definition: MipsMCExpr.h:54
static bool classof(const MCExpr *E)
Definition: MipsMCExpr.h:61
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:29
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:33
This is an extension point for target-specific MCExpr subclasses to implement.
Definition: MCExpr.h:548
void visitUsedExpr(MCStreamer &Streamer) const override
Definition: MipsMCExpr.cpp:88
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
Streaming machine code generation interface.
Definition: MCStreamer.h:157
static bool isSupportedBinaryExpr(MCSymbolRefExpr::VariantKind VK, const MCBinaryExpr *BE)
Definition: MipsMCExpr.cpp:20
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition: MipsMCExpr.cpp:67
MCSection * findAssociatedSection() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Definition: MCExpr.cpp:768
static const MipsMCExpr * create(MCSymbolRefExpr::VariantKind VK, const MCExpr *Expr, MCContext &Ctx)
Definition: MipsMCExpr.cpp:44
PowerPC TLS Dynamic Call Fixup
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override
Definition: MipsMCExpr.h:59
VariantKind getKind() const
getOpcode - Get the kind of this expression.
Definition: MipsMCExpr.h:44
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
Target specific expression.
Definition: MCExpr.h:40