LLVM  15.0.0git
DbiStreamBuilder.cpp
Go to the documentation of this file.
1 //===- DbiStreamBuilder.cpp - PDB Dbi Stream Creation -----------*- 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 
10 
11 #include "llvm/ADT/ArrayRef.h"
12 #include "llvm/BinaryFormat/COFF.h"
18 #include "llvm/Object/COFF.h"
20 #include "llvm/Support/Parallel.h"
21 
22 using namespace llvm;
23 using namespace llvm::codeview;
24 using namespace llvm::msf;
25 using namespace llvm::pdb;
26 
27 DbiStreamBuilder::DbiStreamBuilder(msf::MSFBuilder &Msf)
28  : Msf(Msf), Allocator(Msf.getAllocator()), Age(1), BuildNumber(0),
29  PdbDllVersion(0), PdbDllRbld(0), Flags(0), MachineType(PDB_Machine::x86),
30  Header(nullptr) {}
31 
33 
35 
37 
38 void DbiStreamBuilder::setBuildNumber(uint16_t B) { BuildNumber = B; }
39 
40 void DbiStreamBuilder::setBuildNumber(uint8_t Major, uint8_t Minor) {
41  BuildNumber = (uint16_t(Major) << DbiBuildNo::BuildMajorShift) &
43  BuildNumber |= (uint16_t(Minor) << DbiBuildNo::BuildMinorShift) &
45  BuildNumber |= DbiBuildNo::NewVersionFormatMask;
46 }
47 
48 void DbiStreamBuilder::setPdbDllVersion(uint16_t V) { PdbDllVersion = V; }
49 
51 
53 
55 
57  // These enums are mirrors of each other, so we can just cast the value.
58  MachineType = static_cast<pdb::PDB_Machine>(static_cast<unsigned>(M));
59 }
60 
62  GlobalsStreamIndex = Index;
63 }
64 
66  SymRecordStreamIndex = Index;
67 }
68 
70  PublicsStreamIndex = Index;
71 }
72 
74  if (!NewFpoData)
75  NewFpoData.emplace(false);
76 
77  NewFpoData->addFrameData(FD);
78 }
79 
81  OldFpoData.push_back(FD);
82 }
83 
87  "NewFPO data should be written via addFrameData()!");
88 
89  DbgStreams[(int)Type].emplace();
90  DbgStreams[(int)Type]->Size = Data.size();
91  DbgStreams[(int)Type]->WriteFn = [Data](BinaryStreamWriter &Writer) {
92  return Writer.writeArray(Data);
93  };
94  return Error::success();
95 }
96 
98  return ECNamesBuilder.insert(Name);
99 }
100 
102  // For now we only support serializing the header.
103  return sizeof(DbiStreamHeader) + calculateFileInfoSubstreamSize() +
104  calculateModiSubstreamSize() + calculateSectionContribsStreamSize() +
105  calculateSectionMapStreamSize() + calculateDbgStreamsSize() +
106  ECNamesBuilder.calculateSerializedSize();
107 }
108 
111  uint32_t Index = ModiList.size();
112  ModiList.push_back(
113  std::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf));
114  return *ModiList.back();
115 }
116 
118  StringRef File) {
119  uint32_t Index = SourceFileNames.size();
120  SourceFileNames.insert(std::make_pair(File, Index));
121  Module.addSourceFile(File);
122  return Error::success();
123 }
124 
126  auto NameIter = SourceFileNames.find(File);
127  if (NameIter == SourceFileNames.end())
128  return make_error<RawError>(raw_error_code::no_entry,
129  "The specified source file was not found");
130  return NameIter->getValue();
131 }
132 
133 uint32_t DbiStreamBuilder::calculateModiSubstreamSize() const {
134  uint32_t Size = 0;
135  for (const auto &M : ModiList)
136  Size += M->calculateSerializedLength();
137  return Size;
138 }
139 
140 uint32_t DbiStreamBuilder::calculateSectionContribsStreamSize() const {
141  if (SectionContribs.empty())
142  return 0;
143  return sizeof(enum PdbRaw_DbiSecContribVer) +
144  sizeof(SectionContribs[0]) * SectionContribs.size();
145 }
146 
147 uint32_t DbiStreamBuilder::calculateSectionMapStreamSize() const {
148  if (SectionMap.empty())
149  return 0;
150  return sizeof(SecMapHeader) + sizeof(SecMapEntry) * SectionMap.size();
151 }
152 
153 uint32_t DbiStreamBuilder::calculateNamesOffset() const {
154  uint32_t Offset = 0;
155  Offset += sizeof(ulittle16_t); // NumModules
156  Offset += sizeof(ulittle16_t); // NumSourceFiles
157  Offset += ModiList.size() * sizeof(ulittle16_t); // ModIndices
158  Offset += ModiList.size() * sizeof(ulittle16_t); // ModFileCounts
159  uint32_t NumFileInfos = 0;
160  for (const auto &M : ModiList)
161  NumFileInfos += M->source_files().size();
162  Offset += NumFileInfos * sizeof(ulittle32_t); // FileNameOffsets
163  return Offset;
164 }
165 
166 uint32_t DbiStreamBuilder::calculateFileInfoSubstreamSize() const {
167  uint32_t Size = calculateNamesOffset();
168  Size += calculateNamesBufferSize();
169  return alignTo(Size, sizeof(uint32_t));
170 }
171 
172 uint32_t DbiStreamBuilder::calculateNamesBufferSize() const {
173  uint32_t Size = 0;
174  for (const auto &F : SourceFileNames) {
175  Size += F.getKeyLength() + 1; // Names[I];
176  }
177  return Size;
178 }
179 
180 uint32_t DbiStreamBuilder::calculateDbgStreamsSize() const {
181  return DbgStreams.size() * sizeof(uint16_t);
182 }
183 
184 Error DbiStreamBuilder::generateFileInfoSubstream() {
185  uint32_t Size = calculateFileInfoSubstreamSize();
186  auto Data = Allocator.Allocate<uint8_t>(Size);
187  uint32_t NamesOffset = calculateNamesOffset();
188 
191 
192  WritableBinaryStreamRef MetadataBuffer =
193  WritableBinaryStreamRef(FileInfoBuffer).keep_front(NamesOffset);
194  BinaryStreamWriter MetadataWriter(MetadataBuffer);
195 
196  uint16_t ModiCount = std::min<uint32_t>(UINT16_MAX, ModiList.size());
197  uint16_t FileCount = std::min<uint32_t>(UINT16_MAX, SourceFileNames.size());
198  if (auto EC = MetadataWriter.writeInteger(ModiCount)) // NumModules
199  return EC;
200  if (auto EC = MetadataWriter.writeInteger(FileCount)) // NumSourceFiles
201  return EC;
202  for (uint16_t I = 0; I < ModiCount; ++I) {
203  if (auto EC = MetadataWriter.writeInteger(I)) // Mod Indices
204  return EC;
205  }
206  for (const auto &MI : ModiList) {
207  FileCount = static_cast<uint16_t>(MI->source_files().size());
208  if (auto EC = MetadataWriter.writeInteger(FileCount)) // Mod File Counts
209  return EC;
210  }
211 
212  // Before writing the FileNameOffsets array, write the NamesBuffer array.
213  // A side effect of this is that this will actually compute the various
214  // file name offsets, so we can then go back and write the FileNameOffsets
215  // array to the other substream.
216  NamesBuffer = WritableBinaryStreamRef(FileInfoBuffer).drop_front(NamesOffset);
217  BinaryStreamWriter NameBufferWriter(NamesBuffer);
218  for (auto &Name : SourceFileNames) {
219  Name.second = NameBufferWriter.getOffset();
220  if (auto EC = NameBufferWriter.writeCString(Name.getKey()))
221  return EC;
222  }
223 
224  for (const auto &MI : ModiList) {
225  for (StringRef Name : MI->source_files()) {
226  auto Result = SourceFileNames.find(Name);
227  if (Result == SourceFileNames.end())
228  return make_error<RawError>(raw_error_code::no_entry,
229  "The source file was not found.");
230  if (auto EC = MetadataWriter.writeInteger(Result->second))
231  return EC;
232  }
233  }
234 
235  if (auto EC = NameBufferWriter.padToAlignment(sizeof(uint32_t)))
236  return EC;
237 
238  if (NameBufferWriter.bytesRemaining() > 0)
239  return make_error<RawError>(raw_error_code::invalid_format,
240  "The names buffer contained unexpected data.");
241 
242  if (MetadataWriter.bytesRemaining() > sizeof(uint32_t))
243  return make_error<RawError>(
245  "The metadata buffer contained unexpected data.");
246 
247  return Error::success();
248 }
249 
251  if (Header)
252  return Error::success();
253 
254  for (auto &MI : ModiList)
255  MI->finalize();
256 
257  if (auto EC = generateFileInfoSubstream())
258  return EC;
259 
261  ::memset(H, 0, sizeof(DbiStreamHeader));
262  H->VersionHeader = *VerHeader;
263  H->VersionSignature = -1;
264  H->Age = Age;
265  H->BuildNumber = BuildNumber;
266  H->Flags = Flags;
267  H->PdbDllRbld = PdbDllRbld;
268  H->PdbDllVersion = PdbDllVersion;
269  H->MachineType = static_cast<uint16_t>(MachineType);
270 
271  H->ECSubstreamSize = ECNamesBuilder.calculateSerializedSize();
272  H->FileInfoSize = FileInfoBuffer.getLength();
273  H->ModiSubstreamSize = calculateModiSubstreamSize();
274  H->OptionalDbgHdrSize = DbgStreams.size() * sizeof(uint16_t);
275  H->SecContrSubstreamSize = calculateSectionContribsStreamSize();
276  H->SectionMapSize = calculateSectionMapStreamSize();
277  H->TypeServerSize = 0;
278  H->SymRecordStreamIndex = SymRecordStreamIndex;
279  H->PublicSymbolStreamIndex = PublicsStreamIndex;
280  H->MFCTypeServerIndex = 0; // Not sure what this is, but link.exe writes 0.
281  H->GlobalSymbolStreamIndex = GlobalsStreamIndex;
282 
283  Header = H;
284  return Error::success();
285 }
286 
288  if (NewFpoData) {
289  DbgStreams[(int)DbgHeaderType::NewFPO].emplace();
290  DbgStreams[(int)DbgHeaderType::NewFPO]->Size =
291  NewFpoData->calculateSerializedSize();
292  DbgStreams[(int)DbgHeaderType::NewFPO]->WriteFn =
293  [this](BinaryStreamWriter &Writer) {
294  return NewFpoData->commit(Writer);
295  };
296  }
297 
298  if (!OldFpoData.empty()) {
299  DbgStreams[(int)DbgHeaderType::FPO].emplace();
300  DbgStreams[(int)DbgHeaderType::FPO]->Size =
301  sizeof(object::FpoData) * OldFpoData.size();
302  DbgStreams[(int)DbgHeaderType::FPO]->WriteFn =
303  [this](BinaryStreamWriter &Writer) {
304  return Writer.writeArray(makeArrayRef(OldFpoData));
305  };
306  }
307 
308  for (auto &S : DbgStreams) {
309  if (!S)
310  continue;
311  auto ExpectedIndex = Msf.addStream(S->Size);
312  if (!ExpectedIndex)
313  return ExpectedIndex.takeError();
314  S->StreamNumber = *ExpectedIndex;
315  }
316 
317  for (auto &MI : ModiList) {
318  if (auto EC = MI->finalizeMsfLayout())
319  return EC;
320  }
321 
323  if (auto EC = Msf.setStreamSize(StreamDBI, Length))
324  return EC;
325  return Error::success();
326 }
327 
329  uint16_t Ret = 0;
330  if (Flags & COFF::IMAGE_SCN_MEM_READ)
331  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Read);
332  if (Flags & COFF::IMAGE_SCN_MEM_WRITE)
333  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Write);
334  if (Flags & COFF::IMAGE_SCN_MEM_EXECUTE)
335  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Execute);
336  if (!(Flags & COFF::IMAGE_SCN_MEM_16BIT))
338 
339  // This seems always 1.
340  Ret |= static_cast<uint16_t>(OMFSegDescFlags::IsSelector);
341 
342  return Ret;
343 }
344 
345 // Populate the Section Map from COFF section headers.
346 //
347 // A Section Map seem to be a copy of a COFF section list in other format.
348 // I don't know why a PDB file contains both a COFF section header and
349 // a Section Map, but it seems it must be present in a PDB.
352  int Idx = 0;
353 
354  auto Add = [&]() -> SecMapEntry & {
355  SectionMap.emplace_back();
356  auto &Entry = SectionMap.back();
357  memset(&Entry, 0, sizeof(Entry));
358 
359  Entry.Frame = Idx + 1;
360 
361  // We don't know the meaning of these fields yet.
362  Entry.SecName = UINT16_MAX;
363  Entry.ClassName = UINT16_MAX;
364 
365  return Entry;
366  };
367 
368  for (auto &Hdr : SecHdrs) {
369  auto &Entry = Add();
370  Entry.Flags = toSecMapFlags(Hdr.Characteristics);
371  Entry.SecByteLength = Hdr.VirtualSize;
372  ++Idx;
373  }
374 
375  // The last entry is for absolute symbols.
376  auto &Entry = Add();
377  Entry.Flags = static_cast<uint16_t>(OMFSegDescFlags::AddressIs32Bit) |
379  Entry.SecByteLength = UINT32_MAX;
380 }
381 
383  WritableBinaryStreamRef MsfBuffer) {
384  if (auto EC = finalize())
385  return EC;
386 
387  auto DbiS = WritableMappedBlockStream::createIndexedStream(
388  Layout, MsfBuffer, StreamDBI, Allocator);
389 
390  BinaryStreamWriter Writer(*DbiS);
391  if (auto EC = Writer.writeObject(*Header))
392  return EC;
393 
394  for (auto &M : ModiList) {
395  if (auto EC = M->commit(Writer))
396  return EC;
397  }
398 
399  // Commit symbol streams. This is a lot of data, so do it in parallel.
400  if (auto EC = parallelForEachError(
401  ModiList, [&](std::unique_ptr<DbiModuleDescriptorBuilder> &M) {
402  return M->commitSymbolStream(Layout, MsfBuffer);
403  }))
404  return EC;
405 
406  if (!SectionContribs.empty()) {
407  if (auto EC = Writer.writeEnum(DbiSecContribVer60))
408  return EC;
409  if (auto EC = Writer.writeArray(makeArrayRef(SectionContribs)))
410  return EC;
411  }
412 
413  if (!SectionMap.empty()) {
414  ulittle16_t Size = static_cast<ulittle16_t>(SectionMap.size());
415  SecMapHeader SMHeader = {Size, Size};
416  if (auto EC = Writer.writeObject(SMHeader))
417  return EC;
418  if (auto EC = Writer.writeArray(makeArrayRef(SectionMap)))
419  return EC;
420  }
421 
422  if (auto EC = Writer.writeStreamRef(FileInfoBuffer))
423  return EC;
424 
425  if (auto EC = ECNamesBuilder.commit(Writer))
426  return EC;
427 
428  for (auto &Stream : DbgStreams) {
429  uint16_t StreamNumber = kInvalidStreamIndex;
430  if (Stream.hasValue())
431  StreamNumber = Stream->StreamNumber;
432  if (auto EC = Writer.writeInteger(StreamNumber))
433  return EC;
434  }
435 
436  for (auto &Stream : DbgStreams) {
437  if (!Stream.hasValue())
438  continue;
439  assert(Stream->StreamNumber != kInvalidStreamIndex);
440 
441  auto WritableStream = WritableMappedBlockStream::createIndexedStream(
442  Layout, MsfBuffer, Stream->StreamNumber, Allocator);
443  BinaryStreamWriter DbgStreamWriter(*WritableStream);
444 
445  if (auto EC = Stream->WriteFn(DbgStreamWriter))
446  return EC;
447  }
448 
449  if (Writer.bytesRemaining() > 0)
450  return make_error<RawError>(raw_error_code::invalid_format,
451  "Unexpected bytes found in DBI Stream");
452  return Error::success();
453 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
llvm::alignTo
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:156
llvm::pdb::DbiStreamBuilder::commit
Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef MsfBuffer)
Definition: DbiStreamBuilder.cpp:382
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
llvm::pdb::DbiSecContribVer60
@ DbiSecContribVer60
Definition: RawConstants.h:68
llvm::pdb::DbiStreamBuilder::setBuildNumber
void setBuildNumber(uint16_t B)
Definition: DbiStreamBuilder.cpp:38
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::BinaryStreamWriter::writeInteger
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
Definition: BinaryStreamWriter.h:58
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::pdb::DbiBuildNo::BuildMajorMask
static const uint16_t BuildMajorMask
Definition: RawTypes.h:112
llvm::pdb::DbiBuildNo::BuildMinorMask
static const uint16_t BuildMinorMask
uint16_t MinorVersion : 8; uint16_t MajorVersion : 7; uint16_t NewVersionFormat : 1;
Definition: RawTypes.h:109
llvm::MutableBinaryByteStream
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer.
Definition: BinaryByteStream.h:88
llvm::parallelForEachError
Error parallelForEachError(RangeTy &&R, FuncTy Fn)
Definition: Parallel.h:242
llvm::BinaryStreamWriter::writeEnum
Error writeEnum(T Num)
Similar to writeInteger.
Definition: BinaryStreamWriter.h:68
llvm::pdb::DbiStreamBuilder::addModuleInfo
Expected< DbiModuleDescriptorBuilder & > addModuleInfo(StringRef ModuleName)
Definition: DbiStreamBuilder.cpp:110
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:30
llvm::pdb::StreamDBI
@ StreamDBI
Definition: RawConstants.h:80
llvm::pdb::DbiStreamBuilder::setMachineType
void setMachineType(PDB_Machine M)
Definition: DbiStreamBuilder.cpp:54
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:329
llvm::pdb::DbiStreamBuilder::~DbiStreamBuilder
~DbiStreamBuilder()
llvm::BinaryStreamWriter::writeStreamRef
Error writeStreamRef(BinaryStreamRef Ref)
Efficiently reads all data from Ref, and writes it to this stream.
Definition: BinaryStreamWriter.cpp:60
llvm::pdb::kInvalidStreamIndex
const uint16_t kInvalidStreamIndex
Definition: RawConstants.h:19
llvm::pdb::DbiStreamBuilder::addDbgStream
Error addDbgStream(pdb::DbgHeaderType Type, ArrayRef< uint8_t > Data)
Definition: DbiStreamBuilder.cpp:84
COFF.h
llvm::pdb::OMFSegDescFlags::IsAbsoluteAddress
@ IsAbsoluteAddress
llvm::StringMap::end
iterator end()
Definition: StringMap.h:205
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::codeview::FrameData
Data in the SUBSEC_FRAMEDATA subection.
Definition: CodeView.h:574
llvm::pdb::raw_error_code::invalid_format
@ invalid_format
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:79
llvm::pdb::DbiStreamBuilder::addModuleSourceFile
Error addModuleSourceFile(DbiModuleDescriptorBuilder &Module, StringRef File)
Definition: DbiStreamBuilder.cpp:117
llvm::pdb::DbiStreamBuilder::setVersionHeader
void setVersionHeader(PdbRaw_DbiVer V)
Definition: DbiStreamBuilder.cpp:34
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:119
llvm::msf::MSFBuilder::addStream
Expected< uint32_t > addStream(uint32_t Size, ArrayRef< uint32_t > Blocks)
Add a stream to the MSF file with the given size, occupying the given list of blocks.
Definition: MSFBuilder.cpp:155
llvm::BinaryStreamWriter::writeArray
Error writeArray(ArrayRef< T > Array)
Writes an array of objects of type T to the underlying stream, as if by using memcpy.
Definition: BinaryStreamWriter.h:145
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::pdb::DbiStreamBuilder::addNewFpoData
void addNewFpoData(const codeview::FrameData &FD)
Definition: DbiStreamBuilder.cpp:73
llvm::StringMap::find
iterator find(StringRef Key)
Definition: StringMap.h:218
llvm::pdb::DbiBuildNo::BuildMinorShift
static const uint16_t BuildMinorShift
Definition: RawTypes.h:110
llvm::pdb::DbiBuildNo::NewVersionFormatMask
static const uint16_t NewVersionFormatMask
Definition: RawTypes.h:115
x86
Note that only the low bits of effective_addr2 are used On bit we don t eliminate the computation of the top half of effective_addr2 because we don t have whole function selection dags On x86
Definition: README.txt:318
RawError.h
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::pdb::DbiStreamBuilder::addOldFpoData
void addOldFpoData(const object::FpoData &Fpo)
Definition: DbiStreamBuilder.cpp:80
llvm::msf
Definition: IMSFFile.h:18
llvm::pdb::PDBStringTableBuilder::commit
Error commit(BinaryStreamWriter &Writer) const
Definition: PDBStringTableBuilder.cpp:209
llvm::msf::MSFBuilder
Definition: MSFBuilder.h:27
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::RISCVFenceField::R
@ R
Definition: RISCVBaseInfo.h:240
llvm::pdb::DbiStreamHeader
The fixed size header that appears at the beginning of the DBI Stream.
Definition: RawTypes.h:119
llvm::pdb::SecMapEntry
Definition: RawTypes.h:74
llvm::pdb::PDBStringTableBuilder::insert
uint32_t insert(StringRef S)
Definition: PDBStringTableBuilder.cpp:46
llvm::pdb::DbiStreamBuilder::createSectionMap
void createSectionMap(ArrayRef< llvm::object::coff_section > SecHdrs)
Definition: DbiStreamBuilder.cpp:350
llvm::MutableArrayRef< uint8_t >
llvm::pdb::DbiStreamBuilder::getSourceFileNameIndex
Expected< uint32_t > getSourceFileNameIndex(StringRef FileName)
Definition: DbiStreamBuilder.cpp:125
llvm::support::little
@ little
Definition: Endian.h:27
llvm::msf::MSFLayout
Definition: MSFCommon.h:51
finalize
arc branch finalize
Definition: ARCBranchFinalize.cpp:65
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:276
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
Parallel.h
llvm::COFF::IMAGE_SCN_MEM_READ
@ IMAGE_SCN_MEM_READ
Definition: COFF.h:320
llvm::ms_demangle::QualifierMangleMode::Result
@ Result
llvm::MutableBinaryByteStream::getLength
uint64_t getLength() override
Return the number of bytes of data in this stream.
Definition: BinaryByteStream.h:109
llvm::dwarf::Index
Index
Definition: Dwarf.h:472
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::pdb::SecMapHeader
Definition: RawTypes.h:66
MSFBuilder.h
llvm::BinaryStreamRefBase::keep_front
RefType keep_front(uint64_t N) const
Return a new BinaryStreamRef with only the first N elements remaining.
Definition: BinaryStreamRef.h:98
llvm::pdb::DbgHeaderType::FPO
@ FPO
llvm::pdb::DbiStreamBuilder::addECName
uint32_t addECName(StringRef Name)
Definition: DbiStreamBuilder.cpp:97
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
llvm::pdb::DbiStreamBuilder::setPdbDllVersion
void setPdbDllVersion(uint16_t V)
Definition: DbiStreamBuilder.cpp:48
llvm::pdb::DbgHeaderType::NewFPO
@ NewFPO
llvm::support::ulittle32_t
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
Definition: Endian.h:272
llvm::pdb::DbiStreamBuilder::setPublicsStreamIndex
void setPublicsStreamIndex(uint32_t Index)
Definition: DbiStreamBuilder.cpp:69
llvm::pdb::OMFSegDescFlags::Read
@ Read
llvm::support::ulittle16_t
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
Definition: Endian.h:270
llvm::BinaryStreamWriter::bytesRemaining
uint64_t bytesRemaining() const
Definition: BinaryStreamWriter.h:180
Index
uint32_t Index
Definition: ELFObjHandler.cpp:82
llvm::pdb::DbiStreamBuilder::setFlags
void setFlags(uint16_t F)
Definition: DbiStreamBuilder.cpp:52
llvm::pdb::DbiStreamBuilder::setGlobalsStreamIndex
void setGlobalsStreamIndex(uint32_t Index)
Definition: DbiStreamBuilder.cpp:61
llvm::pdb::PdbRaw_DbiSecContribVer
PdbRaw_DbiSecContribVer
Definition: RawConstants.h:67
I
#define I(x, y, z)
Definition: MD5.cpp:58
ArrayRef.h
MappedBlockStream.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ModuleName
Definition: ItaniumDemangle.h:989
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::StringMapImpl::size
unsigned size() const
Definition: StringMap.h:95
llvm::msf::MSFBuilder::setStreamSize
Error setStreamSize(uint32_t Idx, uint32_t Size)
Update the size of an existing stream.
Definition: MSFBuilder.cpp:192
llvm::ArrayRef< uint8_t >
llvm::BinaryStreamWriter::writeObject
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
Definition: BinaryStreamWriter.h:129
llvm::pdb::PdbRaw_DbiVer
PdbRaw_DbiVer
Definition: RawConstants.h:51
llvm::pdb::PDB_Machine
PDB_Machine
Definition: PDBTypes.h:125
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::pdb::DbiBuildNo::BuildMajorShift
static const uint16_t BuildMajorShift
Definition: RawTypes.h:113
DbiStreamBuilder.h
if
if(llvm_vc STREQUAL "") set(fake_version_inc "$
Definition: CMakeLists.txt:14
A
* A
Definition: README_ALTIVEC.txt:89
uint32_t
llvm::pdb::DbiStreamBuilder::finalizeMsfLayout
Error finalizeMsfLayout()
Definition: DbiStreamBuilder.cpp:287
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::pdb::DbiStreamBuilder::setSymbolRecordStreamIndex
void setSymbolRecordStreamIndex(uint32_t Index)
Definition: DbiStreamBuilder.cpp:65
llvm::pdb::PDBStringTableBuilder::calculateSerializedSize
uint32_t calculateSerializedSize() const
Definition: PDBStringTableBuilder.cpp:140
llvm::pdb::DbiStreamBuilder::setAge
void setAge(uint32_t A)
Definition: DbiStreamBuilder.cpp:36
llvm::pdb::DbiStreamBuilder::setPdbDllRbld
void setPdbDllRbld(uint16_t R)
Definition: DbiStreamBuilder.cpp:50
toSecMapFlags
static uint16_t toSecMapFlags(uint32_t Flags)
Definition: DbiStreamBuilder.cpp:328
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
H
#define H(x, y, z)
Definition: MD5.cpp:57
uint16_t
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::pdb::OMFSegDescFlags::AddressIs32Bit
@ AddressIs32Bit
llvm::pdb::DbiModuleDescriptorBuilder
Definition: DbiModuleDescriptorBuilder.h:63
llvm::COFF::MachineTypes
MachineTypes
Definition: COFF.h:92
llvm::MCID::Add
@ Add
Definition: MCInstrDesc.h:185
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:475
llvm::pdb::DbiStreamBuilder::calculateSerializedLength
uint32_t calculateSerializedLength() const
Definition: DbiStreamBuilder.cpp:101
COFF.h
llvm::pdb::raw_error_code::no_entry
@ no_entry
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:142
DebugFrameDataSubsection.h
llvm::pdb::DbgHeaderType
DbgHeaderType
Definition: RawConstants.h:86
llvm::COFF::IMAGE_SCN_MEM_EXECUTE
@ IMAGE_SCN_MEM_EXECUTE
Definition: COFF.h:319
BinaryStreamWriter.h
llvm::COFF::IMAGE_SCN_MEM_16BIT
@ IMAGE_SCN_MEM_16BIT
Definition: COFF.h:296
llvm::pdb::OMFSegDescFlags::Write
@ Write
DbiModuleDescriptorBuilder.h
llvm::pdb::OMFSegDescFlags::IsSelector
@ IsSelector
llvm::pdb::OMFSegDescFlags::Execute
@ Execute
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:198
llvm::WritableBinaryStreamRef
Definition: BinaryStreamRef.h:220
llvm::BinaryStreamRefBase::drop_front
RefType drop_front(uint64_t N) const
Return a new BinaryStreamRef with the first N elements removed.
Definition: BinaryStreamRef.h:60
llvm::COFF::IMAGE_SCN_MEM_WRITE
@ IMAGE_SCN_MEM_WRITE
Definition: COFF.h:321
llvm::object::FpoData
Definition: COFF.h:1278