LLVM  14.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"
19 #include "llvm/Object/COFF.h"
21 #include "llvm/Support/Parallel.h"
22 
23 using namespace llvm;
24 using namespace llvm::codeview;
25 using namespace llvm::msf;
26 using namespace llvm::pdb;
27 
28 DbiStreamBuilder::DbiStreamBuilder(msf::MSFBuilder &Msf)
29  : Msf(Msf), Allocator(Msf.getAllocator()), Age(1), BuildNumber(0),
30  PdbDllVersion(0), PdbDllRbld(0), Flags(0), MachineType(PDB_Machine::x86),
31  Header(nullptr) {}
32 
34 
36 
37 void DbiStreamBuilder::setAge(uint32_t A) { Age = A; }
38 
39 void DbiStreamBuilder::setBuildNumber(uint16_t B) { BuildNumber = B; }
40 
41 void DbiStreamBuilder::setBuildNumber(uint8_t Major, uint8_t Minor) {
42  BuildNumber = (uint16_t(Major) << DbiBuildNo::BuildMajorShift) &
44  BuildNumber |= (uint16_t(Minor) << DbiBuildNo::BuildMinorShift) &
46  BuildNumber |= DbiBuildNo::NewVersionFormatMask;
47 }
48 
49 void DbiStreamBuilder::setPdbDllVersion(uint16_t V) { PdbDllVersion = V; }
50 
51 void DbiStreamBuilder::setPdbDllRbld(uint16_t R) { PdbDllRbld = R; }
52 
54 
56 
58  // These enums are mirrors of each other, so we can just cast the value.
59  MachineType = static_cast<pdb::PDB_Machine>(static_cast<unsigned>(M));
60 }
61 
63  GlobalsStreamIndex = Index;
64 }
65 
67  SymRecordStreamIndex = Index;
68 }
69 
71  PublicsStreamIndex = Index;
72 }
73 
75  if (!NewFpoData.hasValue())
76  NewFpoData.emplace(false);
77 
78  NewFpoData->addFrameData(FD);
79 }
80 
82  OldFpoData.push_back(FD);
83 }
84 
86  ArrayRef<uint8_t> Data) {
88  "NewFPO data should be written via addFrameData()!");
89 
90  DbgStreams[(int)Type].emplace();
91  DbgStreams[(int)Type]->Size = Data.size();
92  DbgStreams[(int)Type]->WriteFn = [Data](BinaryStreamWriter &Writer) {
93  return Writer.writeArray(Data);
94  };
95  return Error::success();
96 }
97 
99  return ECNamesBuilder.insert(Name);
100 }
101 
103  // For now we only support serializing the header.
104  return sizeof(DbiStreamHeader) + calculateFileInfoSubstreamSize() +
105  calculateModiSubstreamSize() + calculateSectionContribsStreamSize() +
106  calculateSectionMapStreamSize() + calculateDbgStreamsSize() +
107  ECNamesBuilder.calculateSerializedSize();
108 }
109 
112  uint32_t Index = ModiList.size();
113  ModiList.push_back(
114  std::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf));
115  return *ModiList.back();
116 }
117 
119  StringRef File) {
120  uint32_t Index = SourceFileNames.size();
121  SourceFileNames.insert(std::make_pair(File, Index));
122  Module.addSourceFile(File);
123  return Error::success();
124 }
125 
127  auto NameIter = SourceFileNames.find(File);
128  if (NameIter == SourceFileNames.end())
129  return make_error<RawError>(raw_error_code::no_entry,
130  "The specified source file was not found");
131  return NameIter->getValue();
132 }
133 
134 uint32_t DbiStreamBuilder::calculateModiSubstreamSize() const {
135  uint32_t Size = 0;
136  for (const auto &M : ModiList)
137  Size += M->calculateSerializedLength();
138  return Size;
139 }
140 
141 uint32_t DbiStreamBuilder::calculateSectionContribsStreamSize() const {
142  if (SectionContribs.empty())
143  return 0;
144  return sizeof(enum PdbRaw_DbiSecContribVer) +
145  sizeof(SectionContribs[0]) * SectionContribs.size();
146 }
147 
148 uint32_t DbiStreamBuilder::calculateSectionMapStreamSize() const {
149  if (SectionMap.empty())
150  return 0;
151  return sizeof(SecMapHeader) + sizeof(SecMapEntry) * SectionMap.size();
152 }
153 
154 uint32_t DbiStreamBuilder::calculateNamesOffset() const {
155  uint32_t Offset = 0;
156  Offset += sizeof(ulittle16_t); // NumModules
157  Offset += sizeof(ulittle16_t); // NumSourceFiles
158  Offset += ModiList.size() * sizeof(ulittle16_t); // ModIndices
159  Offset += ModiList.size() * sizeof(ulittle16_t); // ModFileCounts
160  uint32_t NumFileInfos = 0;
161  for (const auto &M : ModiList)
162  NumFileInfos += M->source_files().size();
163  Offset += NumFileInfos * sizeof(ulittle32_t); // FileNameOffsets
164  return Offset;
165 }
166 
167 uint32_t DbiStreamBuilder::calculateFileInfoSubstreamSize() const {
168  uint32_t Size = calculateNamesOffset();
169  Size += calculateNamesBufferSize();
170  return alignTo(Size, sizeof(uint32_t));
171 }
172 
173 uint32_t DbiStreamBuilder::calculateNamesBufferSize() const {
174  uint32_t Size = 0;
175  for (const auto &F : SourceFileNames) {
176  Size += F.getKeyLength() + 1; // Names[I];
177  }
178  return Size;
179 }
180 
181 uint32_t DbiStreamBuilder::calculateDbgStreamsSize() const {
182  return DbgStreams.size() * sizeof(uint16_t);
183 }
184 
185 Error DbiStreamBuilder::generateFileInfoSubstream() {
186  uint32_t Size = calculateFileInfoSubstreamSize();
187  auto Data = Allocator.Allocate<uint8_t>(Size);
188  uint32_t NamesOffset = calculateNamesOffset();
189 
190  FileInfoBuffer = MutableBinaryByteStream(MutableArrayRef<uint8_t>(Data, Size),
192 
193  WritableBinaryStreamRef MetadataBuffer =
194  WritableBinaryStreamRef(FileInfoBuffer).keep_front(NamesOffset);
195  BinaryStreamWriter MetadataWriter(MetadataBuffer);
196 
197  uint16_t ModiCount = std::min<uint32_t>(UINT16_MAX, ModiList.size());
198  uint16_t FileCount = std::min<uint32_t>(UINT16_MAX, SourceFileNames.size());
199  if (auto EC = MetadataWriter.writeInteger(ModiCount)) // NumModules
200  return EC;
201  if (auto EC = MetadataWriter.writeInteger(FileCount)) // NumSourceFiles
202  return EC;
203  for (uint16_t I = 0; I < ModiCount; ++I) {
204  if (auto EC = MetadataWriter.writeInteger(I)) // Mod Indices
205  return EC;
206  }
207  for (const auto &MI : ModiList) {
208  FileCount = static_cast<uint16_t>(MI->source_files().size());
209  if (auto EC = MetadataWriter.writeInteger(FileCount)) // Mod File Counts
210  return EC;
211  }
212 
213  // Before writing the FileNameOffsets array, write the NamesBuffer array.
214  // A side effect of this is that this will actually compute the various
215  // file name offsets, so we can then go back and write the FileNameOffsets
216  // array to the other substream.
217  NamesBuffer = WritableBinaryStreamRef(FileInfoBuffer).drop_front(NamesOffset);
218  BinaryStreamWriter NameBufferWriter(NamesBuffer);
219  for (auto &Name : SourceFileNames) {
220  Name.second = NameBufferWriter.getOffset();
221  if (auto EC = NameBufferWriter.writeCString(Name.getKey()))
222  return EC;
223  }
224 
225  for (const auto &MI : ModiList) {
226  for (StringRef Name : MI->source_files()) {
227  auto Result = SourceFileNames.find(Name);
228  if (Result == SourceFileNames.end())
229  return make_error<RawError>(raw_error_code::no_entry,
230  "The source file was not found.");
231  if (auto EC = MetadataWriter.writeInteger(Result->second))
232  return EC;
233  }
234  }
235 
236  if (auto EC = NameBufferWriter.padToAlignment(sizeof(uint32_t)))
237  return EC;
238 
239  if (NameBufferWriter.bytesRemaining() > 0)
240  return make_error<RawError>(raw_error_code::invalid_format,
241  "The names buffer contained unexpected data.");
242 
243  if (MetadataWriter.bytesRemaining() > sizeof(uint32_t))
244  return make_error<RawError>(
246  "The metadata buffer contained unexpected data.");
247 
248  return Error::success();
249 }
250 
251 Error DbiStreamBuilder::finalize() {
252  if (Header)
253  return Error::success();
254 
255  for (auto &MI : ModiList)
256  MI->finalize();
257 
258  if (auto EC = generateFileInfoSubstream())
259  return EC;
260 
261  DbiStreamHeader *H = Allocator.Allocate<DbiStreamHeader>();
262  ::memset(H, 0, sizeof(DbiStreamHeader));
263  H->VersionHeader = *VerHeader;
264  H->VersionSignature = -1;
265  H->Age = Age;
266  H->BuildNumber = BuildNumber;
267  H->Flags = Flags;
268  H->PdbDllRbld = PdbDllRbld;
269  H->PdbDllVersion = PdbDllVersion;
270  H->MachineType = static_cast<uint16_t>(MachineType);
271 
272  H->ECSubstreamSize = ECNamesBuilder.calculateSerializedSize();
273  H->FileInfoSize = FileInfoBuffer.getLength();
274  H->ModiSubstreamSize = calculateModiSubstreamSize();
275  H->OptionalDbgHdrSize = DbgStreams.size() * sizeof(uint16_t);
276  H->SecContrSubstreamSize = calculateSectionContribsStreamSize();
277  H->SectionMapSize = calculateSectionMapStreamSize();
278  H->TypeServerSize = 0;
279  H->SymRecordStreamIndex = SymRecordStreamIndex;
280  H->PublicSymbolStreamIndex = PublicsStreamIndex;
281  H->MFCTypeServerIndex = 0; // Not sure what this is, but link.exe writes 0.
282  H->GlobalSymbolStreamIndex = GlobalsStreamIndex;
283 
284  Header = H;
285  return Error::success();
286 }
287 
289  if (NewFpoData.hasValue()) {
290  DbgStreams[(int)DbgHeaderType::NewFPO].emplace();
291  DbgStreams[(int)DbgHeaderType::NewFPO]->Size =
292  NewFpoData->calculateSerializedSize();
293  DbgStreams[(int)DbgHeaderType::NewFPO]->WriteFn =
294  [this](BinaryStreamWriter &Writer) {
295  return NewFpoData->commit(Writer);
296  };
297  }
298 
299  if (!OldFpoData.empty()) {
300  DbgStreams[(int)DbgHeaderType::FPO].emplace();
301  DbgStreams[(int)DbgHeaderType::FPO]->Size =
302  sizeof(object::FpoData) * OldFpoData.size();
303  DbgStreams[(int)DbgHeaderType::FPO]->WriteFn =
304  [this](BinaryStreamWriter &Writer) {
305  return Writer.writeArray(makeArrayRef(OldFpoData));
306  };
307  }
308 
309  for (auto &S : DbgStreams) {
310  if (!S.hasValue())
311  continue;
312  auto ExpectedIndex = Msf.addStream(S->Size);
313  if (!ExpectedIndex)
314  return ExpectedIndex.takeError();
315  S->StreamNumber = *ExpectedIndex;
316  }
317 
318  for (auto &MI : ModiList) {
319  if (auto EC = MI->finalizeMsfLayout())
320  return EC;
321  }
322 
324  if (auto EC = Msf.setStreamSize(StreamDBI, Length))
325  return EC;
326  return Error::success();
327 }
328 
330  uint16_t Ret = 0;
331  if (Flags & COFF::IMAGE_SCN_MEM_READ)
332  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Read);
333  if (Flags & COFF::IMAGE_SCN_MEM_WRITE)
334  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Write);
335  if (Flags & COFF::IMAGE_SCN_MEM_EXECUTE)
336  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Execute);
337  if (Flags & COFF::IMAGE_SCN_MEM_EXECUTE)
338  Ret |= static_cast<uint16_t>(OMFSegDescFlags::Execute);
339  if (!(Flags & COFF::IMAGE_SCN_MEM_16BIT))
341 
342  // This seems always 1.
343  Ret |= static_cast<uint16_t>(OMFSegDescFlags::IsSelector);
344 
345  return Ret;
346 }
347 
348 // Populate the Section Map from COFF section headers.
349 //
350 // A Section Map seem to be a copy of a COFF section list in other format.
351 // I don't know why a PDB file contains both a COFF section header and
352 // a Section Map, but it seems it must be present in a PDB.
355  int Idx = 0;
356 
357  auto Add = [&]() -> SecMapEntry & {
358  SectionMap.emplace_back();
359  auto &Entry = SectionMap.back();
360  memset(&Entry, 0, sizeof(Entry));
361 
362  Entry.Frame = Idx + 1;
363 
364  // We don't know the meaning of these fields yet.
365  Entry.SecName = UINT16_MAX;
366  Entry.ClassName = UINT16_MAX;
367 
368  return Entry;
369  };
370 
371  for (auto &Hdr : SecHdrs) {
372  auto &Entry = Add();
373  Entry.Flags = toSecMapFlags(Hdr.Characteristics);
374  Entry.SecByteLength = Hdr.VirtualSize;
375  ++Idx;
376  }
377 
378  // The last entry is for absolute symbols.
379  auto &Entry = Add();
380  Entry.Flags = static_cast<uint16_t>(OMFSegDescFlags::AddressIs32Bit) |
382  Entry.SecByteLength = UINT32_MAX;
383 }
384 
386  WritableBinaryStreamRef MsfBuffer) {
387  if (auto EC = finalize())
388  return EC;
389 
390  auto DbiS = WritableMappedBlockStream::createIndexedStream(
391  Layout, MsfBuffer, StreamDBI, Allocator);
392 
393  BinaryStreamWriter Writer(*DbiS);
394  if (auto EC = Writer.writeObject(*Header))
395  return EC;
396 
397  for (auto &M : ModiList) {
398  if (auto EC = M->commit(Writer))
399  return EC;
400  }
401 
402  // Commit symbol streams. This is a lot of data, so do it in parallel.
403  if (auto EC = parallelForEachError(
404  ModiList, [&](std::unique_ptr<DbiModuleDescriptorBuilder> &M) {
405  return M->commitSymbolStream(Layout, MsfBuffer);
406  }))
407  return EC;
408 
409  if (!SectionContribs.empty()) {
410  if (auto EC = Writer.writeEnum(DbiSecContribVer60))
411  return EC;
412  if (auto EC = Writer.writeArray(makeArrayRef(SectionContribs)))
413  return EC;
414  }
415 
416  if (!SectionMap.empty()) {
417  ulittle16_t Size = static_cast<ulittle16_t>(SectionMap.size());
418  SecMapHeader SMHeader = {Size, Size};
419  if (auto EC = Writer.writeObject(SMHeader))
420  return EC;
421  if (auto EC = Writer.writeArray(makeArrayRef(SectionMap)))
422  return EC;
423  }
424 
425  if (auto EC = Writer.writeStreamRef(FileInfoBuffer))
426  return EC;
427 
428  if (auto EC = ECNamesBuilder.commit(Writer))
429  return EC;
430 
431  for (auto &Stream : DbgStreams) {
432  uint16_t StreamNumber = kInvalidStreamIndex;
433  if (Stream.hasValue())
434  StreamNumber = Stream->StreamNumber;
435  if (auto EC = Writer.writeInteger(StreamNumber))
436  return EC;
437  }
438 
439  for (auto &Stream : DbgStreams) {
440  if (!Stream.hasValue())
441  continue;
442  assert(Stream->StreamNumber != kInvalidStreamIndex);
443 
444  auto WritableStream = WritableMappedBlockStream::createIndexedStream(
445  Layout, MsfBuffer, Stream->StreamNumber, Allocator);
446  BinaryStreamWriter DbgStreamWriter(*WritableStream);
447 
448  if (auto EC = Stream->WriteFn(DbgStreamWriter))
449  return EC;
450  }
451 
452  if (Writer.bytesRemaining() > 0)
453  return make_error<RawError>(raw_error_code::invalid_format,
454  "Unexpected bytes found in DBI Stream");
455  return Error::success();
456 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::alignTo
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:148
llvm::pdb::DbiStreamBuilder::commit
Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef MsfBuffer)
Definition: DbiStreamBuilder.cpp:385
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:103
llvm::pdb::DbiSecContribVer60
@ DbiSecContribVer60
Definition: RawConstants.h:68
llvm::pdb::DbiStreamBuilder::setBuildNumber
void setBuildNumber(uint16_t B)
Definition: DbiStreamBuilder.cpp:39
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::BinaryStreamWriter::writeInteger
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
Definition: BinaryStreamWriter.h:64
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:89
llvm::parallelForEachError
Error parallelForEachError(RangeTy &&R, FuncTy Fn)
Definition: Parallel.h:316
llvm::BinaryStreamWriter::writeEnum
Error writeEnum(T Num)
Similar to writeInteger.
Definition: BinaryStreamWriter.h:74
llvm::pdb::DbiStreamBuilder::addModuleInfo
Expected< DbiModuleDescriptorBuilder & > addModuleInfo(StringRef ModuleName)
Definition: DbiStreamBuilder.cpp:111
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:31
llvm::pdb::StreamDBI
@ StreamDBI
Definition: RawConstants.h:80
llvm::pdb::DbiStreamBuilder::setMachineType
void setMachineType(PDB_Machine M)
Definition: DbiStreamBuilder.cpp:55
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:331
llvm::pdb::DbiStreamBuilder::~DbiStreamBuilder
~DbiStreamBuilder()
Definition: DbiStreamBuilder.cpp:33
llvm::BinaryStreamWriter::writeStreamRef
Error writeStreamRef(BinaryStreamRef Ref)
Efficiently reads all data from Ref, and writes it to this stream.
Definition: BinaryStreamWriter.cpp:61
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:85
COFF.h
llvm::pdb::OMFSegDescFlags::IsAbsoluteAddress
@ IsAbsoluteAddress
llvm::StringMap::end
iterator end()
Definition: StringMap.h:203
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:572
llvm::pdb::raw_error_code::invalid_format
@ invalid_format
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::pdb::DbiStreamBuilder::addModuleSourceFile
Error addModuleSourceFile(DbiModuleDescriptorBuilder &Module, StringRef File)
Definition: DbiStreamBuilder.cpp:118
llvm::pdb::DbiStreamBuilder::setVersionHeader
void setVersionHeader(PdbRaw_DbiVer V)
Definition: DbiStreamBuilder.cpp:35
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:116
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:151
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::pdb::DbiStreamBuilder::addNewFpoData
void addNewFpoData(const codeview::FrameData &FD)
Definition: DbiStreamBuilder.cpp:74
llvm::StringMap::find
iterator find(StringRef Key)
Definition: StringMap.h:216
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:81
llvm::msf
Definition: IMSFFile.h:18
llvm::pdb::PDBStringTableBuilder::commit
Error commit(BinaryStreamWriter &Writer) const
Definition: PDBStringTableBuilder.cpp:208
llvm::msf::MSFBuilder
Definition: MSFBuilder.h:26
F
#define F(x, y, z)
Definition: MD5.cpp:56
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:353
llvm::MutableArrayRef< uint8_t >
llvm::BumpPtrAllocatorImpl::Allocate
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, Align Alignment)
Allocate space at the specified alignment.
Definition: Allocator.h:145
llvm::pdb::DbiStreamBuilder::getSourceFileNameIndex
Expected< uint32_t > getSourceFileNameIndex(StringRef FileName)
Definition: DbiStreamBuilder.cpp:126
llvm::support::little
@ little
Definition: Endian.h:27
llvm::msf::MSFLayout
Definition: MSFCommon.h:51
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:274
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:321
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:110
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:99
llvm::pdb::DbgHeaderType::FPO
@ FPO
llvm::pdb::DbiStreamBuilder::addECName
uint32_t addECName(StringRef Name)
Definition: DbiStreamBuilder.cpp:98
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
llvm::pdb::DbiStreamBuilder::setPdbDllVersion
void setPdbDllVersion(uint16_t V)
Definition: DbiStreamBuilder.cpp:49
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:70
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:186
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::pdb::DbiStreamBuilder::setFlags
void setFlags(uint16_t F)
Definition: DbiStreamBuilder.cpp:53
llvm::pdb::DbiStreamBuilder::setGlobalsStreamIndex
void setGlobalsStreamIndex(uint32_t Index)
Definition: DbiStreamBuilder.cpp:62
llvm::pdb::PdbRaw_DbiSecContribVer
PdbRaw_DbiSecContribVer
Definition: RawConstants.h:67
I
#define I(x, y, z)
Definition: MD5.cpp:59
ArrayRef.h
MappedBlockStream.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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:67
llvm::StringMapImpl::size
unsigned size() const
Definition: StringMap.h:93
llvm::msf::MSFBuilder::setStreamSize
Error setStreamSize(uint32_t Idx, uint32_t Size)
Update the size of an existing stream.
Definition: MSFBuilder.cpp:192
DbiStream.h
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:135
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
uint32_t
llvm::pdb::DbiStreamBuilder::finalizeMsfLayout
Error finalizeMsfLayout()
Definition: DbiStreamBuilder.cpp:288
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:66
llvm::pdb::PDBStringTableBuilder::calculateSerializedSize
uint32_t calculateSerializedSize() const
Definition: PDBStringTableBuilder.cpp:139
llvm::pdb::DbiStreamBuilder::setAge
void setAge(uint32_t A)
Definition: DbiStreamBuilder.cpp:37
llvm::pdb::DbiStreamBuilder::setPdbDllRbld
void setPdbDllRbld(uint16_t R)
Definition: DbiStreamBuilder.cpp:51
toSecMapFlags
static uint16_t toSecMapFlags(uint32_t Flags)
Definition: DbiStreamBuilder.cpp:329
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
H
#define H(x, y, z)
Definition: MD5.cpp:58
uint16_t
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::pdb::OMFSegDescFlags::AddressIs32Bit
@ AddressIs32Bit
llvm::pdb::DbiModuleDescriptorBuilder
Definition: DbiModuleDescriptorBuilder.h:65
llvm::COFF::MachineTypes
MachineTypes
Definition: COFF.h:93
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:476
llvm::pdb::DbiStreamBuilder::calculateSerializedLength
uint32_t calculateSerializedLength() const
Definition: DbiStreamBuilder.cpp:102
COFF.h
llvm::pdb::raw_error_code::no_entry
@ no_entry
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:146
DebugFrameDataSubsection.h
llvm::pdb::DbgHeaderType
DbgHeaderType
Definition: RawConstants.h:86
llvm::COFF::IMAGE_SCN_MEM_EXECUTE
@ IMAGE_SCN_MEM_EXECUTE
Definition: COFF.h:320
BinaryStreamWriter.h
llvm::COFF::IMAGE_SCN_MEM_16BIT
@ IMAGE_SCN_MEM_16BIT
Definition: COFF.h:297
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:205
llvm::WritableBinaryStreamRef
Definition: BinaryStreamRef.h:221
llvm::BinaryStreamRefBase::drop_front
RefType drop_front(uint64_t N) const
Return a new BinaryStreamRef with the first N elements removed.
Definition: BinaryStreamRef.h:61
llvm::COFF::IMAGE_SCN_MEM_WRITE
@ IMAGE_SCN_MEM_WRITE
Definition: COFF.h:322
llvm::object::FpoData
Definition: COFF.h:1276