LLVM
5.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
include
llvm
MC
MCSymbolWasm.h
Go to the documentation of this file.
1
//===- MCSymbolWasm.h - ----------------------------------------*- 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
#ifndef LLVM_MC_MCSYMBOLWASM_H
10
#define LLVM_MC_MCSYMBOLWASM_H
11
12
#include "
llvm/BinaryFormat/Wasm.h
"
13
#include "
llvm/MC/MCSymbol.h
"
14
15
namespace
llvm {
16
17
class
MCSymbolWasm
:
public
MCSymbol
{
18
private
:
19
bool
IsFunction =
false
;
20
bool
IsWeak =
false
;
21
std::string ModuleName;
22
SmallVector<wasm::ValType, 1>
Returns;
23
SmallVector<wasm::ValType, 4>
Params;
24
bool
ParamsSet =
false
;
25
bool
ReturnsSet =
false
;
26
27
/// An expression describing how to calculate the size of a symbol. If a
28
/// symbol has no size this field will be NULL.
29
const
MCExpr
*SymbolSize =
nullptr
;
30
31
public
:
32
// Use a module name of "env" for now, for compatibility with existing tools.
33
// This is temporary, and may change, as the ABI is not yet stable.
34
MCSymbolWasm
(
const
StringMapEntry<bool>
*
Name
,
bool
isTemporary
)
35
:
MCSymbol
(
SymbolKindWasm
, Name, isTemporary),
36
ModuleName(
"env"
) {}
37
static
bool
classof
(
const
MCSymbol
*S) {
return
S->
isWasm
(); }
38
39
const
MCExpr
*
getSize
()
const
{
return
SymbolSize; }
40
void
setSize
(
const
MCExpr
*SS) { SymbolSize = SS; }
41
42
bool
isFunction
()
const
{
return
IsFunction; }
43
void
setIsFunction
(
bool
isFunc) { IsFunction = isFunc; }
44
45
bool
isWeak
()
const
{
return
IsWeak; }
46
void
setWeak
(
bool
isWeak
) { IsWeak =
isWeak
; }
47
48
const
StringRef
getModuleName
()
const
{
return
ModuleName; }
49
50
const
SmallVector<wasm::ValType, 1>
&
getReturns
()
const
{
51
assert
(ReturnsSet);
52
return
Returns;
53
}
54
55
void
setReturns
(
SmallVectorImpl<wasm::ValType>
&&Rets) {
56
ReturnsSet =
true
;
57
Returns = std::move(Rets);
58
}
59
60
const
SmallVector<wasm::ValType, 4>
&
getParams
()
const
{
61
assert
(ParamsSet);
62
return
Params;
63
}
64
65
void
setParams
(
SmallVectorImpl<wasm::ValType>
&&Pars) {
66
ParamsSet =
true
;
67
Params = std::move(Pars);
68
}
69
};
70
71
}
// end namespace llvm
72
73
#endif // LLVM_MC_MCSYMBOLWASM_H
llvm::MCSymbolWasm
Definition:
MCSymbolWasm.h:17
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition:
StringMap.h:125
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:
MCSymbol.h:42
llvm::MCSymbolWasm::setWeak
void setWeak(bool isWeak)
Definition:
MCSymbolWasm.h:46
llvm::MCSymbolWasm::classof
static bool classof(const MCSymbol *S)
Definition:
MCSymbolWasm.h:37
llvm::MCSymbolWasm::getParams
const SmallVector< wasm::ValType, 4 > & getParams() const
Definition:
MCSymbolWasm.h:60
llvm::MCSymbolWasm::setParams
void setParams(SmallVectorImpl< wasm::ValType > &&Pars)
Definition:
MCSymbolWasm.h:65
llvm::MCSymbolWasm::getSize
const MCExpr * getSize() const
Definition:
MCSymbolWasm.h:39
llvm::MCSymbolWasm::setSize
void setSize(const MCExpr *SS)
Definition:
MCSymbolWasm.h:40
llvm::SmallVectorImpl< wasm::ValType >
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition:
MCExpr.h:36
Wasm.h
llvm::MCSymbolWasm::getModuleName
const StringRef getModuleName() const
Definition:
MCSymbolWasm.h:48
Name
const char * Name
Definition:
AArch64AsmParser.cpp:3839
llvm::MCSymbolWasm::setReturns
void setReturns(SmallVectorImpl< wasm::ValType > &&Rets)
Definition:
MCSymbolWasm.h:55
llvm::MCSymbolWasm::isFunction
bool isFunction() const
Definition:
MCSymbolWasm.h:42
MCSymbol.h
llvm::MCSymbolWasm::setIsFunction
void setIsFunction(bool isFunc)
Definition:
MCSymbolWasm.h:43
llvm::MCSymbolWasm::MCSymbolWasm
MCSymbolWasm(const StringMapEntry< bool > *Name, bool isTemporary)
Definition:
MCSymbolWasm.h:34
llvm::SmallVector< wasm::ValType, 1 >
llvm::MCSymbolWasm::getReturns
const SmallVector< wasm::ValType, 1 > & getReturns() const
Definition:
MCSymbolWasm.h:50
llvm::MCSymbol::isTemporary
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
Definition:
MCSymbol.h:220
llvm::MCSymbolWasm::isWeak
bool isWeak() const
Definition:
MCSymbolWasm.h:45
llvm::MCSymbol::SymbolKindWasm
Definition:
MCSymbol.h:51
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCSymbol::isWasm
bool isWasm() const
Definition:
MCSymbol.h:288
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:49
Generated on Fri Sep 1 2017 14:12:34 for LLVM by
1.8.6