MCSymbolELF.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include "llvm/MC/MCSymbol.h"
  12. namespace llvm {
  13. class MCSymbolELF : public MCSymbol {
  14. /// An expression describing how to calculate the size of a symbol. If a
  15. /// symbol has no size this field will be NULL.
  16. const MCExpr *SymbolSize = nullptr;
  17. public:
  18. MCSymbolELF(const StringMapEntry<bool> *Name, bool isTemporary)
  19. : MCSymbol(SymbolKindELF, Name, isTemporary) {}
  20. void setSize(const MCExpr *SS) { SymbolSize = SS; }
  21. const MCExpr *getSize() const { return SymbolSize; }
  22. void setVisibility(unsigned Visibility);
  23. unsigned getVisibility() const;
  24. void setOther(unsigned Other);
  25. unsigned getOther() const;
  26. void setType(unsigned Type) const;
  27. unsigned getType() const;
  28. void setBinding(unsigned Binding) const;
  29. unsigned getBinding() const;
  30. bool isBindingSet() const;
  31. void setIsWeakrefUsedInReloc() const;
  32. bool isWeakrefUsedInReloc() const;
  33. void setIsSignature() const;
  34. bool isSignature() const;
  35. static bool classof(const MCSymbol *S) { return S->isELF(); }
  36. private:
  37. void setIsBindingSet() const;
  38. };
  39. }
  40. #endif