1 //===- MCSymbolELF.h - -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_MC_MCSYMBOLELF_H
10 #define LLVM_MC_MCSYMBOLELF_H
12 #include "llvm/MC/MCSymbol.h"
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;
20 mutable unsigned BindingSet : 1;
21 mutable unsigned UsedInReloc : 1;
22 mutable unsigned WeakrefUsedInReloc : 1;
23 mutable unsigned IsSignature : 1;
26 MCSymbolELF(const StringMapEntry<bool> *Name, bool isTemporary)
27 : MCSymbol(true, Name, isTemporary), BindingSet(false),
28 UsedInReloc(false), WeakrefUsedInReloc(false), IsSignature(false) {}
29 void setSize(const MCExpr *SS) { SymbolSize = SS; }
31 const MCExpr *getSize() const { return SymbolSize; }
33 void setVisibility(unsigned Visibility);
34 unsigned getVisibility() const;
36 void setOther(unsigned Other);
37 unsigned getOther() const;
39 void setType(unsigned Type) const;
40 unsigned getType() const;
42 void setBinding(unsigned Binding) const;
43 unsigned getBinding() const;
45 bool isBindingSet() const { return BindingSet; }
47 void setUsedInReloc() const;
48 bool isUsedInReloc() const;
50 void setIsWeakrefUsedInReloc() const;
51 bool isWeakrefUsedInReloc() const;
53 void setIsSignature() const;
54 bool isSignature() const;
56 static bool classof(const MCSymbol *S) { return S->isELF(); }