MCSymbolELF.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MCSymbolELF.h - -----------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_MC_MCSYMBOLELF_H
  14. #define LLVM_MC_MCSYMBOLELF_H
  15. #include "llvm/MC/MCSymbol.h"
  16. namespace llvm {
  17. class MCSymbolELF : public MCSymbol {
  18. /// An expression describing how to calculate the size of a symbol. If a
  19. /// symbol has no size this field will be NULL.
  20. const MCExpr *SymbolSize = nullptr;
  21. public:
  22. MCSymbolELF(const StringMapEntry<bool> *Name, bool isTemporary)
  23. : MCSymbol(SymbolKindELF, Name, isTemporary) {}
  24. void setSize(const MCExpr *SS) { SymbolSize = SS; }
  25. const MCExpr *getSize() const { return SymbolSize; }
  26. void setVisibility(unsigned Visibility);
  27. unsigned getVisibility() const;
  28. void setOther(unsigned Other);
  29. unsigned getOther() const;
  30. void setType(unsigned Type) const;
  31. unsigned getType() const;
  32. void setBinding(unsigned Binding) const;
  33. unsigned getBinding() const;
  34. bool isBindingSet() const;
  35. void setIsWeakrefUsedInReloc() const;
  36. bool isWeakrefUsedInReloc() const;
  37. void setIsSignature() const;
  38. bool isSignature() const;
  39. void setMemtag(bool Tagged);
  40. bool isMemtag() const;
  41. static bool classof(const MCSymbol *S) { return S->isELF(); }
  42. private:
  43. void setIsBindingSet() const;
  44. };
  45. }
  46. #endif
  47. #ifdef __GNUC__
  48. #pragma GCC diagnostic pop
  49. #endif