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 IsSignature : 1;
25 MCSymbolELF(const StringMapEntry<bool> *Name, bool isTemporary)
26 : MCSymbol(true, Name, isTemporary), BindingSet(false) {}
27 void setSize(const MCExpr *SS) { SymbolSize = SS; }
29 const MCExpr *getSize() const { return SymbolSize; }
31 void setVisibility(unsigned Visibility);
32 unsigned getVisibility() const;
34 void setOther(unsigned Other);
35 unsigned getOther() const;
37 void setType(unsigned Type) const;
38 unsigned getType() const;
40 void setBinding(unsigned Binding) const;
41 unsigned getBinding() const;
43 bool isBindingSet() const { return BindingSet; }
45 void setUsedInReloc() const;
46 bool isUsedInReloc() const;
48 void setIsSignature() const;
49 bool isSignature() const;
51 static bool classof(const MCSymbol *S) { return S->isELF(); }