Store whether a symbol is a comdat signature in MCSymbolELF.
[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 IsSignature : 1;
23
24 public:
25   MCSymbolELF(const StringMapEntry<bool> *Name, bool isTemporary)
26       : MCSymbol(true, Name, isTemporary), BindingSet(false) {}
27   void setSize(const MCExpr *SS) { SymbolSize = SS; }
28
29   const MCExpr *getSize() const { return SymbolSize; }
30
31   void setVisibility(unsigned Visibility);
32   unsigned getVisibility() const;
33
34   void setOther(unsigned Other);
35   unsigned getOther() const;
36
37   void setType(unsigned Type) const;
38   unsigned getType() const;
39
40   void setBinding(unsigned Binding) const;
41   unsigned getBinding() const;
42
43   bool isBindingSet() const { return BindingSet; }
44
45   void setUsedInReloc() const;
46   bool isUsedInReloc() const;
47
48   void setIsSignature() const;
49   bool isSignature() const;
50
51   static bool classof(const MCSymbol *S) { return S->isELF(); }
52 };
53 }
54
55 #endif