LLVM  16.0.0git
DebugSymbolsSubsection.cpp
Go to the documentation of this file.
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 
11 
12 using namespace llvm;
13 using namespace llvm::codeview;
14 
16  return Reader.readArray(Records, Reader.getLength());
17 }
18 
20  return Length;
21 }
22 
24  for (const auto &Record : Records) {
25  if (auto EC = Writer.writeBytes(Record.RecordData))
26  return EC;
27  }
28  return Error::success();
29 }
30 
32  Records.push_back(Symbol);
33  Length += Symbol.length();
34 }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:30
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:329
llvm::codeview::DebugSymbolsSubsection::commit
Error commit(BinaryStreamWriter &Writer) const override
Definition: DebugSymbolsSubsection.cpp:23
llvm::BinaryStreamReader::getLength
uint64_t getLength() const
Definition: BinaryStreamReader.h:249
llvm::codeview::DebugSymbolsSubsection::addSymbol
void addSymbol(CVSymbol Symbol)
Definition: DebugSymbolsSubsection.cpp:31
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:29
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::Record
Definition: Record.h:1573
llvm::BinaryStreamWriter::writeBytes
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
Definition: BinaryStreamWriter.cpp:27
llvm::codeview::CVRecord
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:29
uint32_t
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
DebugSymbolsSubsection.h
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::codeview::DebugSymbolsSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugSymbolsSubsection.cpp:15
llvm::codeview::DebugSymbolsSubsection::calculateSerializedSize
uint32_t calculateSerializedSize() const override
Definition: DebugSymbolsSubsection.cpp:19
BinaryStreamWriter.h
llvm::BinaryStreamReader::readArray
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
Definition: BinaryStreamReader.h:180