374e6b87f713fe3b7488b9c5c6cf050e9c5c7284
[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   mutable unsigned UsedInReloc : 1;
22   mutable unsigned WeakrefUsedInReloc : 1;
23   mutable unsigned IsSignature : 1;
24
25 public:
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; }
30
31   const MCExpr *getSize() const { return SymbolSize; }
32
33   void setVisibility(unsigned Visibility);
34   unsigned getVisibility() const;
35
36   void setOther(unsigned Other);
37   unsigned getOther() const;
38
39   void setType(unsigned Type) const;
40   unsigned getType() const;
41
42   void setBinding(unsigned Binding) const;
43   unsigned getBinding() const;
44
45   bool isBindingSet() const { return BindingSet; }
46
47   void setUsedInReloc() const;
48   bool isUsedInReloc() const;
49
50   void setIsWeakrefUsedInReloc() const;
51   bool isWeakrefUsedInReloc() const;
52
53   void setIsSignature() const;
54   bool isSignature() const;
55
56   static bool classof(const MCSymbol *S) { return S->isELF(); }
57 };
58 }
59
60 #endif