LLVM
8.0.1
lib
Target
ARM
MCTargetDesc
ARMMCExpr.cpp
Go to the documentation of this file.
1
//===-- ARMMCExpr.cpp - ARM specific MC expression classes ----------------===//
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
#include "
ARMMCExpr.h
"
11
#include "
llvm/MC/MCContext.h
"
12
#include "
llvm/MC/MCStreamer.h
"
13
using namespace
llvm
;
14
15
#define DEBUG_TYPE "armmcexpr"
16
17
const
ARMMCExpr
*
18
ARMMCExpr::create
(
VariantKind
Kind
,
const
MCExpr
*Expr,
19
MCContext
&Ctx) {
20
return
new
(Ctx)
ARMMCExpr
(Kind, Expr);
21
}
22
23
void
ARMMCExpr::printImpl
(
raw_ostream
&OS,
const
MCAsmInfo
*MAI)
const
{
24
switch
(Kind) {
25
default
:
llvm_unreachable
(
"Invalid kind!"
);
26
case
VK_ARM_HI16
: OS <<
":upper16:"
;
break
;
27
case
VK_ARM_LO16
: OS <<
":lower16:"
;
break
;
28
}
29
30
const
MCExpr
*Expr =
getSubExpr
();
31
if
(Expr->
getKind
() !=
MCExpr::SymbolRef
)
32
OS <<
'('
;
33
Expr->
print
(OS, MAI);
34
if
(Expr->
getKind
() !=
MCExpr::SymbolRef
)
35
OS <<
')'
;
36
}
37
38
void
ARMMCExpr::visitUsedExpr
(
MCStreamer
&Streamer)
const
{
39
Streamer.
visitUsedExpr
(*
getSubExpr
());
40
}
MCContext.h
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::ARMMCExpr::create
static const ARMMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition:
ARMMCExpr.cpp:18
MCStreamer.h
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition:
MCExpr.h:36
llvm::ARMMCExpr
Definition:
ARMMCExpr.h:17
llvm::MCContext
Context object for machine code objects.
Definition:
MCContext.h:63
llvm::ARMMCExpr::visitUsedExpr
void visitUsedExpr(MCStreamer &Streamer) const override
Definition:
ARMMCExpr.cpp:38
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::MCStreamer
Streaming machine code generation interface.
Definition:
MCStreamer.h:189
llvm::MCExpr::print
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Definition:
MCExpr.cpp:42
llvm::ARMMCExpr::VariantKind
VariantKind
Definition:
ARMMCExpr.h:19
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:136
llvm::ARMMCExpr::VK_ARM_HI16
Definition:
ARMMCExpr.h:21
llvm::MCExpr::getKind
ExprKind getKind() const
Definition:
MCExpr.h:73
ARMMCExpr.h
llvm::MCStreamer::visitUsedExpr
void visitUsedExpr(const MCExpr &Expr)
Definition:
MCStreamer.cpp:930
llvm::ARMMCExpr::VK_ARM_LO16
Definition:
ARMMCExpr.h:22
llvm::ARMMCExpr::printImpl
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition:
ARMMCExpr.cpp:23
llvm::ARMMCExpr::getSubExpr
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
Definition:
ARMMCExpr.h:55
llvm::MCExpr::SymbolRef
References to labels and assigned expressions.
Definition:
MCExpr.h:41
Kind
const unsigned Kind
Definition:
ARMAsmParser.cpp:10586
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition:
raw_ostream.h:46
Generated on Sun Dec 20 2020 13:56:37 for LLVM by
1.8.13