1 //===- MCSymbolELF.h - -----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_MC_MCSYMBOLELF_H
9 #define LLVM_MC_MCSYMBOLELF_H
11 #include "llvm/MC/MCSymbol.h"
14 class MCSymbolELF
: public MCSymbol
{
15 /// An expression describing how to calculate the size of a symbol. If a
16 /// symbol has no size this field will be NULL.
17 const MCExpr
*SymbolSize
= nullptr;
20 MCSymbolELF(const StringMapEntry
<bool> *Name
, bool isTemporary
)
21 : MCSymbol(SymbolKindELF
, Name
, isTemporary
) {}
22 void setSize(const MCExpr
*SS
) { SymbolSize
= SS
; }
24 const MCExpr
*getSize() const { return SymbolSize
; }
26 void setVisibility(unsigned Visibility
);
27 unsigned getVisibility() const;
29 void setOther(unsigned Other
);
30 unsigned getOther() const;
32 void setType(unsigned Type
) const;
33 unsigned getType() const;
35 void setBinding(unsigned Binding
) const;
36 unsigned getBinding() const;
38 bool isBindingSet() const;
40 void setIsWeakrefUsedInReloc() const;
41 bool isWeakrefUsedInReloc() const;
43 void setIsSignature() const;
44 bool isSignature() const;
46 static bool classof(const MCSymbol
*S
) { return S
->isELF(); }
49 void setIsBindingSet() const;