xref: /freebsd/contrib/llvm-project/llvm/include/llvm/MC/MCSymbolELF.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 //===- MCSymbolELF.h -  -----------------------------------------*- C++ -*-===//
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 #ifndef LLVM_MC_MCSYMBOLELF_H
9 #define LLVM_MC_MCSYMBOLELF_H
10 
11 #include "llvm/MC/MCSymbol.h"
12 #include "llvm/MC/MCSymbolTableEntry.h"
13 
14 namespace llvm {
15 class MCSymbolELF : public MCSymbol {
16   /// An expression describing how to calculate the size of a symbol. If a
17   /// symbol has no size this field will be NULL.
18   const MCExpr *SymbolSize = nullptr;
19 
20 public:
MCSymbolELF(const MCSymbolTableEntry * Name,bool isTemporary)21   MCSymbolELF(const MCSymbolTableEntry *Name, bool isTemporary)
22       : MCSymbol(SymbolKindELF, Name, isTemporary) {}
setSize(const MCExpr * SS)23   void setSize(const MCExpr *SS) { SymbolSize = SS; }
24 
getSize()25   const MCExpr *getSize() const { return SymbolSize; }
26 
27   void setVisibility(unsigned Visibility);
28   unsigned getVisibility() const;
29 
30   void setOther(unsigned Other);
31   unsigned getOther() const;
32 
33   void setType(unsigned Type) const;
34   unsigned getType() const;
35 
36   void setBinding(unsigned Binding) const;
37   unsigned getBinding() const;
38 
39   bool isBindingSet() const;
40 
41   void setIsWeakrefUsedInReloc() const;
42   bool isWeakrefUsedInReloc() const;
43 
44   void setIsSignature() const;
45   bool isSignature() const;
46 
47   void setMemtag(bool Tagged);
48   bool isMemtag() const;
49 
classof(const MCSymbol * S)50   static bool classof(const MCSymbol *S) { return S->isELF(); }
51 
52 private:
53   void setIsBindingSet() const;
54 };
55 }
56 
57 #endif
58