[AMDGPU] Check for immediate SrcC in mfma in AsmParser
[llvm-core.git] / lib / DebugInfo / PDB / Native / SymbolStream.cpp
blob003840b6e67e8b60a46607a486288fc7d7100661
1 //===- SymbolStream.cpp - PDB Symbol Stream Access ------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/PDB/Native/SymbolStream.h"
11 #include "llvm/DebugInfo/CodeView/CodeView.h"
12 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
13 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
14 #include "llvm/Support/BinaryStreamReader.h"
15 #include "llvm/Support/Endian.h"
17 using namespace llvm;
18 using namespace llvm::msf;
19 using namespace llvm::support;
20 using namespace llvm::pdb;
22 SymbolStream::SymbolStream(std::unique_ptr<MappedBlockStream> Stream)
23 : Stream(std::move(Stream)) {}
25 SymbolStream::~SymbolStream() {}
27 Error SymbolStream::reload() {
28 BinaryStreamReader Reader(*Stream);
30 if (auto EC = Reader.readArray(SymbolRecords, Stream->getLength()))
31 return EC;
33 return Error::success();
36 iterator_range<codeview::CVSymbolArray::Iterator>
37 SymbolStream::getSymbols(bool *HadError) const {
38 return llvm::make_range(SymbolRecords.begin(HadError), SymbolRecords.end());
41 Error SymbolStream::commit() { return Error::success(); }
43 codeview::CVSymbol SymbolStream::readRecord(uint32_t Offset) const {
44 return *SymbolRecords.at(Offset);