LLVM: lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
16
17using namespace llvm;
18
19#define DEBUG_TYPE "hexagon-mcexpr"
20
22 return new (Ctx) HexagonMCExpr(Expr);
23}
24
27 return Expr->evaluateAsRelocatable(Res, Asm);
28}
29
33
35 return Expr->findAssociatedFragment();
36}
37
39
41 assert((!Val || !MustNotExtend) && "Extension contradiction");
42 MustExtend = Val;
43}
44
47 assert((!Val || !MustExtend) && "Extension contradiction");
48 MustNotExtend = Val;
49}
51
54 S27_2_reloc = Val;
55}
56
57HexagonMCExpr::HexagonMCExpr(MCExpr const *Expr)
58 : Expr(Expr), MustNotExtend(false), MustExtend(false), S27_2_reloc(false),
59 SignMismatch(false) {}
60
64
66 SignMismatch = Val;
67}
68
70 return SignMismatch;
71}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
void setMustNotExtend(bool Val=true)
Definition HexagonMCExpr.cpp:46
bool mustNotExtend() const
Definition HexagonMCExpr.cpp:50
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition HexagonMCExpr.cpp:61
bool signMismatch() const
Definition HexagonMCExpr.cpp:69
bool mustExtend() const
Definition HexagonMCExpr.cpp:45
static HexagonMCExpr * create(MCExpr const *Expr, MCContext &Ctx)
Definition HexagonMCExpr.cpp:21
bool s27_2_reloc() const
Definition HexagonMCExpr.cpp:52
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm) const override
Definition HexagonMCExpr.cpp:25
void setMustExtend(bool Val=true)
Definition HexagonMCExpr.cpp:40
MCFragment * findAssociatedFragment() const override
Definition HexagonMCExpr.cpp:34
MCExpr const * getExpr() const
Definition HexagonMCExpr.cpp:38
void setS27_2_reloc(bool Val=true)
Definition HexagonMCExpr.cpp:53
void setSignMismatch(bool Val=true)
Definition HexagonMCExpr.cpp:65
void visitUsedExpr(MCStreamer &Streamer) const override
Definition HexagonMCExpr.cpp:30
This class is intended to be used as a base class for asm properties and features specific to the tar...
void printExpr(raw_ostream &, const MCExpr &) const
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
Streaming machine code generation interface.
void visitUsedExpr(const MCExpr &Expr)
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.