LLVM
20.0.0git
lib
Target
ARM
MCTargetDesc
ARMMCExpr.cpp
Go to the documentation of this file.
1
//===-- ARMMCExpr.cpp - ARM specific MC expression classes ----------------===//
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
#include "
ARMMCExpr.h
"
10
#include "
llvm/MC/MCContext.h
"
11
#include "
llvm/MC/MCStreamer.h
"
12
using namespace
llvm
;
13
14
#define DEBUG_TYPE "armmcexpr"
15
16
const
ARMMCExpr
*
17
ARMMCExpr::create
(
VariantKind
Kind,
const
MCExpr
*Expr,
18
MCContext
&Ctx) {
19
return
new
(Ctx)
ARMMCExpr
(Kind, Expr);
20
}
21
22
void
ARMMCExpr::printImpl
(
raw_ostream
&
OS
,
const
MCAsmInfo
*MAI)
const
{
23
switch
(Kind) {
24
default
:
llvm_unreachable
(
"Invalid kind!"
);
25
case
VK_ARM_HI16
:
26
OS
<<
":upper16:"
;
27
break
;
28
case
VK_ARM_LO16
:
29
OS
<<
":lower16:"
;
30
break
;
31
case
VK_ARM_HI_8_15
:
32
OS
<<
":upper8_15:"
;
33
break
;
34
case
VK_ARM_HI_0_7
:
35
OS
<<
":upper0_7:"
;
36
break
;
37
case
VK_ARM_LO_8_15
:
38
OS
<<
":lower8_15:"
;
39
break
;
40
case
VK_ARM_LO_0_7
:
41
OS
<<
":lower0_7:"
;
42
break
;
43
}
44
45
const
MCExpr
*Expr =
getSubExpr
();
46
if
(Expr->
getKind
() !=
MCExpr::SymbolRef
)
47
OS
<<
'('
;
48
Expr->
print
(
OS
, MAI);
49
if
(Expr->
getKind
() !=
MCExpr::SymbolRef
)
50
OS
<<
')'
;
51
}
52
53
void
ARMMCExpr::visitUsedExpr
(
MCStreamer
&Streamer)
const
{
54
Streamer.
visitUsedExpr
(*
getSubExpr
());
55
}
ARMMCExpr.h
MCContext.h
MCStreamer.h
OS
raw_pwrite_stream & OS
Definition:
SampleProfWriter.cpp:53
llvm::ARMMCExpr
Definition:
ARMMCExpr.h:16
llvm::ARMMCExpr::printImpl
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition:
ARMMCExpr.cpp:22
llvm::ARMMCExpr::getSubExpr
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
Definition:
ARMMCExpr.h:79
llvm::ARMMCExpr::visitUsedExpr
void visitUsedExpr(MCStreamer &Streamer) const override
Definition:
ARMMCExpr.cpp:53
llvm::ARMMCExpr::VariantKind
VariantKind
Definition:
ARMMCExpr.h:18
llvm::ARMMCExpr::VK_ARM_LO16
@ VK_ARM_LO16
Definition:
ARMMCExpr.h:21
llvm::ARMMCExpr::VK_ARM_HI_0_7
@ VK_ARM_HI_0_7
Definition:
ARMMCExpr.h:25
llvm::ARMMCExpr::VK_ARM_LO_8_15
@ VK_ARM_LO_8_15
Definition:
ARMMCExpr.h:27
llvm::ARMMCExpr::VK_ARM_HI_8_15
@ VK_ARM_HI_8_15
Definition:
ARMMCExpr.h:23
llvm::ARMMCExpr::VK_ARM_LO_0_7
@ VK_ARM_LO_0_7
Definition:
ARMMCExpr.h:29
llvm::ARMMCExpr::VK_ARM_HI16
@ VK_ARM_HI16
Definition:
ARMMCExpr.h:20
llvm::ARMMCExpr::create
static const ARMMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition:
ARMMCExpr.cpp:17
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::MCContext
Context object for machine code objects.
Definition:
MCContext.h:83
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition:
MCExpr.h:34
llvm::MCExpr::SymbolRef
@ SymbolRef
References to labels and assigned expressions.
Definition:
MCExpr.h:39
llvm::MCExpr::print
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Definition:
MCExpr.cpp:40
llvm::MCExpr::getKind
ExprKind getKind() const
Definition:
MCExpr.h:78
llvm::MCStreamer
Streaming machine code generation interface.
Definition:
MCStreamer.h:213
llvm::MCStreamer::visitUsedExpr
void visitUsedExpr(const MCExpr &Expr)
Definition:
MCStreamer.cpp:1075
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:
raw_ostream.h:52
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:143
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
Generated on Tue Nov 12 2024 16:07:40 for LLVM by
1.9.6