Convert BindingExplicitlySet into a MCSymbolELF field.
[oota-llvm.git] / include / llvm / MC / MCSymbolELF.h
1 //===- MCSymbolELF.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_MCSYMBOLELF_H
10 #define LLVM_MC_MCSYMBOLELF_H
11
12 #include "llvm/MC/MCSymbol.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   mutable unsigned BindingSet : 1;
21
22 public:
23   MCSymbolELF(const StringMapEntry<bool> *Name, bool isTemporary)
24       : MCSymbol(true, Name, isTemporary), BindingSet(false) {}
25   void setSize(const MCExpr *SS) { SymbolSize = SS; }
26
27   const MCExpr *getSize() const { return SymbolSize; }
28
29   void setVisibility(unsigned Visibility);
30   unsigned getVisibility() const;
31
32   void setOther(unsigned Other);
33   unsigned getOther() const;
34
35   void setType(unsigned Type) const;
36   unsigned getType() const;
37
38   void setBinding(unsigned Binding) const;
39   unsigned getBinding() const;
40
41   bool isBindingSet() const { return BindingSet; }
42
43   static bool classof(const MCSymbol *S) { return S->isELF(); }
44 };
45 }
46
47 #endif