DebugSymbolsSubsection.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. //===- DebugSymbolsSubsection.cpp -------------------------------*- C++ -*-===//
  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/DebugInfo/CodeView/DebugSymbolsSubsection.h"
  9. using namespace llvm;
  10. using namespace llvm::codeview;
  11. Error DebugSymbolsSubsectionRef::initialize(BinaryStreamReader Reader) {
  12. return Reader.readArray(Records, Reader.getLength());
  13. }
  14. uint32_t DebugSymbolsSubsection::calculateSerializedSize() const {
  15. return Length;
  16. }
  17. Error DebugSymbolsSubsection::commit(BinaryStreamWriter &Writer) const {
  18. for (const auto &Record : Records) {
  19. if (auto EC = Writer.writeBytes(Record.RecordData))
  20. return EC;
  21. }
  22. return Error::success();
  23. }
  24. void DebugSymbolsSubsection::addSymbol(CVSymbol Symbol) {
  25. Records.push_back(Symbol);
  26. Length += Symbol.length();
  27. }