MCSymbolXCOFF.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. //===- lib/MC/MCSymbolXCOFF.cpp - XCOFF Code Symbol Representation --------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/MC/MCSectionXCOFF.h"
  9. using namespace llvm;
  10. MCSectionXCOFF *MCSymbolXCOFF::getRepresentedCsect() const {
  11. assert(RepresentedCsect &&
  12. "Trying to get csect representation of this symbol but none was set.");
  13. assert(getSymbolTableName().equals(RepresentedCsect->getSymbolTableName()) &&
  14. "SymbolTableNames need to be the same for this symbol and its csect "
  15. "representation.");
  16. return RepresentedCsect;
  17. }
  18. void MCSymbolXCOFF::setRepresentedCsect(MCSectionXCOFF *C) {
  19. assert(C && "Assigned csect should not be null.");
  20. assert((!RepresentedCsect || RepresentedCsect == C) &&
  21. "Trying to set a csect that doesn't match the one that this symbol is "
  22. "already mapped to.");
  23. assert(getSymbolTableName().equals(C->getSymbolTableName()) &&
  24. "SymbolTableNames need to be the same for this symbol and its csect "
  25. "representation.");
  26. RepresentedCsect = C;
  27. }