aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo')
-rw-r--r--include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/CVRecord.h38
-rw-r--r--include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/CVTypeVisitor.h11
-rw-r--r--include/llvm/DebugInfo/CodeView/CodeView.h29
-rw-r--r--include/llvm/DebugInfo/CodeView/CodeViewError.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h140
-rw-r--r--include/llvm/DebugInfo/CodeView/CodeViewRegisters.def210
-rw-r--r--include/llvm/DebugInfo/CodeView/CodeViewSymbols.def9
-rw-r--r--include/llvm/DebugInfo/CodeView/CodeViewTypes.def7
-rw-r--r--include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h9
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h9
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h14
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/EnumTables.h9
-rw-r--r--include/llvm/DebugInfo/CodeView/Formatters.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/FunctionId.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/GUID.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h29
-rw-r--r--include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/Line.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/RecordName.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/RecordSerialization.h10
-rw-r--r--include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/StringsAndChecksums.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolDeserializer.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolDumper.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolRecord.h66
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolSerializer.h11
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeCollection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeDeserializer.h17
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeHashing.h38
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeIndex.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeRecord.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeRecordMapping.h9
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeStreamMerger.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeTableCollection.h7
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h12
-rw-r--r--include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h7
-rw-r--r--include/llvm/DebugInfo/DIContext.h46
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h23
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFAddressRange.h13
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFAttribute.h21
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFContext.h25
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h11
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugLine.h74
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h11
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h9
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h11
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFDie.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFExpression.h26
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFFormValue.h54
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFListTable.h11
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFObject.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFRelocMap.h14
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFSection.h12
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFUnit.h50
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h7
-rw-r--r--include/llvm/DebugInfo/DWARF/DWARFVerifier.h7
-rw-r--r--include/llvm/DebugInfo/GSYM/FileEntry.h68
-rw-r--r--include/llvm/DebugInfo/GSYM/FunctionInfo.h107
-rw-r--r--include/llvm/DebugInfo/GSYM/InlineInfo.h78
-rw-r--r--include/llvm/DebugInfo/GSYM/LineEntry.h48
-rw-r--r--include/llvm/DebugInfo/GSYM/Range.h87
-rw-r--r--include/llvm/DebugInfo/GSYM/StringTable.h54
-rw-r--r--include/llvm/DebugInfo/MSF/IMSFFile.h7
-rw-r--r--include/llvm/DebugInfo/MSF/MSFBuilder.h7
-rw-r--r--include/llvm/DebugInfo/MSF/MSFCommon.h7
-rw-r--r--include/llvm/DebugInfo/MSF/MSFError.h7
-rw-r--r--include/llvm/DebugInfo/MSF/MappedBlockStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIADataStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAError.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h9
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIASession.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIASourceFile.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIASupport.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIATable.h7
-rw-r--r--include/llvm/DebugInfo/PDB/DIA/DIAUtils.h7
-rw-r--r--include/llvm/DebugInfo/PDB/GenericError.h9
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBDataStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBEnumChildren.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBFrameData.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBInjectedSource.h13
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBLineNumber.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBRawSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBSectionContrib.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBSession.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBSourceFile.h7
-rw-r--r--include/llvm/DebugInfo/PDB/IPDBTable.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiModuleList.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiStream.h26
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/EnumTables.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/Formatters.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/GlobalsStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/Hash.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/HashTable.h92
-rw-r--r--include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/InfoStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h44
-rw-r--r--include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h9
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h9
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h43
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeSession.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/PDBFile.h23
-rw-r--r--include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h9
-rw-r--r--include/llvm/DebugInfo/PDB/Native/PDBStringTable.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/PublicsStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/RawConstants.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/RawError.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/RawTypes.h18
-rw-r--r--include/llvm/DebugInfo/PDB/Native/SymbolCache.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/SymbolStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/TpiHashing.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/TpiStream.h7
-rw-r--r--include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDB.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBContext.h16
-rw-r--r--include/llvm/DebugInfo/PDB/PDBExtras.h13
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymDumper.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolBlock.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolCustom.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolData.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolExe.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolFunc.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolLabel.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolThunk.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h7
-rw-r--r--include/llvm/DebugInfo/PDB/PDBTypes.h76
-rw-r--r--include/llvm/DebugInfo/PDB/UDTLayout.h7
-rw-r--r--include/llvm/DebugInfo/Symbolize/DIPrinter.h20
-rw-r--r--include/llvm/DebugInfo/Symbolize/SymbolizableModule.h20
-rw-r--r--include/llvm/DebugInfo/Symbolize/Symbolize.h56
223 files changed, 2040 insertions, 1143 deletions
diff --git a/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h b/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
index bd1743511ed4..0ac8b651939d 100644
--- a/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
+++ b/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
@@ -1,9 +1,8 @@
//===- AppendingTypeTableBuilder.h -------------------------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/CVRecord.h b/include/llvm/DebugInfo/CodeView/CVRecord.h
index 11ca9ff108de..784c47e3bf5d 100644
--- a/include/llvm/DebugInfo/CodeView/CVRecord.h
+++ b/include/llvm/DebugInfo/CodeView/CVRecord.h
@@ -1,9 +1,8 @@
-//===- RecordIterator.h -----------------------------------------*- C++ -*-===//
+//===- CVRecord.h -----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -25,17 +24,31 @@ namespace llvm {
namespace codeview {
+/// CVRecord is a fat pointer (base + size pair) to a symbol or type record.
+/// Carrying the size separately instead of trusting the size stored in the
+/// record prefix provides some extra safety and flexibility.
template <typename Kind> class CVRecord {
public:
- CVRecord() : Type(static_cast<Kind>(0)) {}
+ CVRecord() = default;
+
+ CVRecord(ArrayRef<uint8_t> Data) : RecordData(Data) {}
- CVRecord(Kind K, ArrayRef<uint8_t> Data) : Type(K), RecordData(Data) {}
+ CVRecord(const RecordPrefix *P, size_t Size)
+ : RecordData(reinterpret_cast<const uint8_t *>(P), Size) {}
- bool valid() const { return Type != static_cast<Kind>(0); }
+ bool valid() const { return kind() != Kind(0); }
uint32_t length() const { return RecordData.size(); }
- Kind kind() const { return Type; }
+
+ Kind kind() const {
+ if (RecordData.size() < sizeof(RecordPrefix))
+ return Kind(0);
+ return static_cast<Kind>(static_cast<uint16_t>(
+ reinterpret_cast<const RecordPrefix *>(RecordData.data())->RecordKind));
+ }
+
ArrayRef<uint8_t> data() const { return RecordData; }
+
StringRef str_data() const {
return StringRef(reinterpret_cast<const char *>(RecordData.data()),
RecordData.size());
@@ -45,7 +58,6 @@ public:
return RecordData.drop_front(sizeof(RecordPrefix));
}
- Kind Type;
ArrayRef<uint8_t> RecordData;
};
@@ -72,8 +84,7 @@ Error forEachCodeViewRecord(ArrayRef<uint8_t> StreamBuffer, Func F) {
ArrayRef<uint8_t> Data = StreamBuffer.take_front(RealLen);
StreamBuffer = StreamBuffer.drop_front(RealLen);
- Record R(static_cast<decltype(Record::Type)>((uint16_t)Prefix->RecordKind),
- Data);
+ Record R(Data);
if (auto EC = F(R))
return EC;
}
@@ -92,13 +103,12 @@ inline Expected<CVRecord<Kind>> readCVRecordFromStream(BinaryStreamRef Stream,
return std::move(EC);
if (Prefix->RecordLen < 2)
return make_error<CodeViewError>(cv_error_code::corrupt_record);
- Kind K = static_cast<Kind>(uint16_t(Prefix->RecordKind));
Reader.setOffset(Offset);
ArrayRef<uint8_t> RawData;
if (auto EC = Reader.readBytes(RawData, Prefix->RecordLen + sizeof(uint16_t)))
return std::move(EC);
- return codeview::CVRecord<Kind>(K, RawData);
+ return codeview::CVRecord<Kind>(RawData);
}
} // end namespace codeview
diff --git a/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h b/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
index 7c8cd121751a..1615ff41df12 100644
--- a/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
+++ b/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
@@ -1,9 +1,8 @@
//===- CVSymbolVisitor.h ----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h b/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
index b765ba1abb4d..7d20bb0a7bde 100644
--- a/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
+++ b/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
@@ -1,9 +1,8 @@
//===- CVTypeVisitor.h ------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -12,6 +11,7 @@
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
#include "llvm/Support/Error.h"
namespace llvm {
@@ -31,6 +31,9 @@ enum VisitorDataSource {
Error visitTypeRecord(CVType &Record, TypeIndex Index,
TypeVisitorCallbacks &Callbacks,
VisitorDataSource Source = VDS_BytesPresent);
+Error visitTypeRecord(CVType &Record, TypeIndex Index,
+ TypeVisitorCallbackPipeline &Callbacks,
+ VisitorDataSource Source = VDS_BytesPresent);
Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
VisitorDataSource Source = VDS_BytesPresent);
diff --git a/include/llvm/DebugInfo/CodeView/CodeView.h b/include/llvm/DebugInfo/CodeView/CodeView.h
index 8e0d9f608e93..c3acb05ea8b1 100644
--- a/include/llvm/DebugInfo/CodeView/CodeView.h
+++ b/include/llvm/DebugInfo/CodeView/CodeView.h
@@ -1,9 +1,8 @@
//===- CodeView.h -----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -160,9 +159,10 @@ enum SourceLanguage : uint8_t {
MSIL = 0x0f,
HLSL = 0x10,
- /// The DMD compiler emits 'D' for the CV source language. Microsoft doesn't
- /// have an enumerator for it yet.
+ /// The DMD & Swift compilers emit 'D' and 'S', respectively, for the CV
+ /// source language. Microsoft does not have enumerators for them yet.
D = 'D',
+ Swift = 'S',
};
/// These values correspond to the CV_call_e enumeration, and are documented
@@ -304,6 +304,9 @@ enum class ModifierOptions : uint16_t {
};
CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(ModifierOptions)
+// If the subsection kind has this bit set, then the linker should ignore it.
+enum : uint32_t { SubsectionIgnoreFlag = 0x80000000 };
+
enum class DebugSubsectionKind : uint32_t {
None = 0,
Symbols = 0xf1,
@@ -509,9 +512,23 @@ enum class FrameCookieKind : uint8_t {
// Corresponds to CV_HREG_e enum.
enum class RegisterId : uint16_t {
+#define CV_REGISTERS_ALL
#define CV_REGISTER(name, value) name = value,
#include "CodeViewRegisters.def"
#undef CV_REGISTER
+#undef CV_REGISTERS_ALL
+};
+
+// Register Ids are shared between architectures in CodeView. CPUType is needed
+// to map register Id to name.
+struct CPURegister {
+ CPURegister() = delete;
+ CPURegister(CPUType Cpu, codeview::RegisterId Reg) {
+ this->Cpu = Cpu;
+ this->Reg = Reg;
+ }
+ CPUType Cpu;
+ RegisterId Reg;
};
/// Two-bit value indicating which register is the designated frame pointer
diff --git a/include/llvm/DebugInfo/CodeView/CodeViewError.h b/include/llvm/DebugInfo/CodeView/CodeViewError.h
index d4615d02220d..9990c8d05d1c 100644
--- a/include/llvm/DebugInfo/CodeView/CodeViewError.h
+++ b/include/llvm/DebugInfo/CodeView/CodeViewError.h
@@ -1,9 +1,8 @@
//===- CodeViewError.h - Error extensions for CodeView ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h b/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
index 94f104ff772c..00fb0cf4cc90 100644
--- a/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
+++ b/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
@@ -1,9 +1,8 @@
//===- CodeViewRecordIO.h ---------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -25,28 +24,65 @@
#include <type_traits>
namespace llvm {
+
namespace codeview {
+class CodeViewRecordStreamer {
+public:
+ virtual void EmitBytes(StringRef Data) = 0;
+ virtual void EmitIntValue(uint64_t Value, unsigned Size) = 0;
+ virtual void EmitBinaryData(StringRef Data) = 0;
+ virtual void AddComment(const Twine &T) = 0;
+ virtual ~CodeViewRecordStreamer() = default;
+};
+
class CodeViewRecordIO {
uint32_t getCurrentOffset() const {
- return (isWriting()) ? Writer->getOffset() : Reader->getOffset();
+ if (isWriting())
+ return Writer->getOffset();
+ else if (isReading())
+ return Reader->getOffset();
+ else
+ return 0;
}
public:
+ // deserializes records to structures
explicit CodeViewRecordIO(BinaryStreamReader &Reader) : Reader(&Reader) {}
+
+ // serializes records to buffer
explicit CodeViewRecordIO(BinaryStreamWriter &Writer) : Writer(&Writer) {}
+ // writes records to assembly file using MC library interface
+ explicit CodeViewRecordIO(CodeViewRecordStreamer &Streamer)
+ : Streamer(&Streamer) {}
+
Error beginRecord(Optional<uint32_t> MaxLength);
Error endRecord();
- Error mapInteger(TypeIndex &TypeInd);
+ Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = "");
- bool isReading() const { return Reader != nullptr; }
- bool isWriting() const { return !isReading(); }
+ bool isStreaming() const {
+ return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr);
+ }
+ bool isReading() const {
+ return (Reader != nullptr) && (Streamer == nullptr) && (Writer == nullptr);
+ }
+ bool isWriting() const {
+ return (Writer != nullptr) && (Streamer == nullptr) && (Reader == nullptr);
+ }
uint32_t maxFieldLength() const;
template <typename T> Error mapObject(T &Value) {
+ if (isStreaming()) {
+ StringRef BytesSR =
+ StringRef((reinterpret_cast<const char *>(&Value)), sizeof(Value));
+ Streamer->EmitBytes(BytesSR);
+ incrStreamedLen(sizeof(T));
+ return Error::success();
+ }
+
if (isWriting())
return Writer->writeObject(Value);
@@ -57,41 +93,63 @@ public:
return Error::success();
}
- template <typename T> Error mapInteger(T &Value) {
+ template <typename T> Error mapInteger(T &Value, const Twine &Comment = "") {
+ if (isStreaming()) {
+ emitComment(Comment);
+ Streamer->EmitIntValue((int)Value, sizeof(T));
+ incrStreamedLen(sizeof(T));
+ return Error::success();
+ }
+
if (isWriting())
return Writer->writeInteger(Value);
return Reader->readInteger(Value);
}
- template <typename T> Error mapEnum(T &Value) {
- if (sizeof(Value) > maxFieldLength())
+ template <typename T> Error mapEnum(T &Value, const Twine &Comment = "") {
+ if (!isStreaming() && sizeof(Value) > maxFieldLength())
return make_error<CodeViewError>(cv_error_code::insufficient_buffer);
using U = typename std::underlying_type<T>::type;
U X;
- if (isWriting())
+
+ if (isWriting() || isStreaming())
X = static_cast<U>(Value);
- if (auto EC = mapInteger(X))
+ if (auto EC = mapInteger(X, Comment))
return EC;
+
if (isReading())
Value = static_cast<T>(X);
+
return Error::success();
}
- Error mapEncodedInteger(int64_t &Value);
- Error mapEncodedInteger(uint64_t &Value);
- Error mapEncodedInteger(APSInt &Value);
- Error mapStringZ(StringRef &Value);
- Error mapGuid(GUID &Guid);
+ Error mapEncodedInteger(int64_t &Value, const Twine &Comment = "");
+ Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = "");
+ Error mapEncodedInteger(APSInt &Value, const Twine &Comment = "");
+ Error mapStringZ(StringRef &Value, const Twine &Comment = "");
+ Error mapGuid(GUID &Guid, const Twine &Comment = "");
- Error mapStringZVectorZ(std::vector<StringRef> &Value);
+ Error mapStringZVectorZ(std::vector<StringRef> &Value,
+ const Twine &Comment = "");
template <typename SizeType, typename T, typename ElementMapper>
- Error mapVectorN(T &Items, const ElementMapper &Mapper) {
+ Error mapVectorN(T &Items, const ElementMapper &Mapper,
+ const Twine &Comment = "") {
SizeType Size;
- if (isWriting()) {
+ if (isStreaming()) {
+ Size = static_cast<SizeType>(Items.size());
+ emitComment(Comment);
+ Streamer->EmitIntValue(Size, sizeof(Size));
+ incrStreamedLen(sizeof(Size)); // add 1 for the delimiter
+
+ for (auto &X : Items) {
+ if (auto EC = Mapper(*this, X))
+ return EC;
+ }
+ } else if (isWriting()) {
Size = static_cast<SizeType>(Items.size());
if (auto EC = Writer->writeInteger(Size))
return EC;
@@ -115,8 +173,10 @@ public:
}
template <typename T, typename ElementMapper>
- Error mapVectorTail(T &Items, const ElementMapper &Mapper) {
- if (isWriting()) {
+ Error mapVectorTail(T &Items, const ElementMapper &Mapper,
+ const Twine &Comment = "") {
+ emitComment(Comment);
+ if (isStreaming() || isWriting()) {
for (auto &Item : Items) {
if (auto EC = Mapper(*this, Item))
return EC;
@@ -133,16 +193,44 @@ public:
return Error::success();
}
- Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes);
- Error mapByteVectorTail(std::vector<uint8_t> &Bytes);
+ Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = "");
+ Error mapByteVectorTail(std::vector<uint8_t> &Bytes,
+ const Twine &Comment = "");
Error padToAlignment(uint32_t Align);
Error skipPadding();
+ uint64_t getStreamedLen() {
+ if (isStreaming())
+ return StreamedLen;
+ return 0;
+ }
+
private:
+ void emitEncodedSignedInteger(const int64_t &Value,
+ const Twine &Comment = "");
+ void emitEncodedUnsignedInteger(const uint64_t &Value,
+ const Twine &Comment = "");
Error writeEncodedSignedInteger(const int64_t &Value);
Error writeEncodedUnsignedInteger(const uint64_t &Value);
+ void incrStreamedLen(const uint64_t &Len) {
+ if (isStreaming())
+ StreamedLen += Len;
+ }
+
+ void resetStreamedLen() {
+ if (isStreaming())
+ StreamedLen = 4; // The record prefix is 4 bytes long
+ }
+
+ void emitComment(const Twine &Comment) {
+ if (isStreaming()) {
+ Twine TComment(Comment);
+ Streamer->AddComment(TComment);
+ }
+ }
+
struct RecordLimit {
uint32_t BeginOffset;
Optional<uint32_t> MaxLength;
@@ -163,6 +251,8 @@ private:
BinaryStreamReader *Reader = nullptr;
BinaryStreamWriter *Writer = nullptr;
+ CodeViewRecordStreamer *Streamer = nullptr;
+ uint64_t StreamedLen = 0;
};
} // end namespace codeview
diff --git a/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def b/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
index fdfcf4d53a23..9767e49c44f5 100644
--- a/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
+++ b/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
@@ -1,9 +1,8 @@
//===-- CodeViewRegisters.def - CodeView registers --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -15,8 +14,15 @@
#define CV_REGISTER(name, value)
#endif
+#if !defined(CV_REGISTERS_ALL) && !defined(CV_REGISTERS_X86) && \
+ !defined(CV_REGISTERS_ARM64)
+#error Need include at least one register set.
+#endif
+
// This currently only contains the "register subset shared by all processor
-// types" (ERR etc.) and the x86 registers.
+// types" (ERR etc.) and the x86/arm64 registers.
+
+#if defined(CV_REGISTERS_ALL) || defined(CV_REGISTERS_X86)
// Some system headers define macros that conflict with our enums. Every
// compiler supported by LLVM has the push_macro and pop_macro pragmas, so use
@@ -357,3 +363,197 @@ CV_REGISTER(AMD64_K7, 765)
#pragma pop_macro("CR2")
#pragma pop_macro("CR3")
#pragma pop_macro("CR4")
+
+#endif // defined(CV_REGISTERS_ALL) || defined(CV_REGISTERS_X86)
+
+#if defined(CV_REGISTERS_ALL) || defined(CV_REGISTERS_ARM64)
+
+// ARM64 registers
+
+CV_REGISTER(ARM64_NOREG, 0)
+
+// General purpose 32-bit integer registers
+
+CV_REGISTER(ARM64_W0, 10)
+CV_REGISTER(ARM64_W1, 11)
+CV_REGISTER(ARM64_W2, 12)
+CV_REGISTER(ARM64_W3, 13)
+CV_REGISTER(ARM64_W4, 14)
+CV_REGISTER(ARM64_W5, 15)
+CV_REGISTER(ARM64_W6, 16)
+CV_REGISTER(ARM64_W7, 17)
+CV_REGISTER(ARM64_W8, 18)
+CV_REGISTER(ARM64_W9, 19)
+CV_REGISTER(ARM64_W10, 20)
+CV_REGISTER(ARM64_W11, 21)
+CV_REGISTER(ARM64_W12, 22)
+CV_REGISTER(ARM64_W13, 23)
+CV_REGISTER(ARM64_W14, 24)
+CV_REGISTER(ARM64_W15, 25)
+CV_REGISTER(ARM64_W16, 26)
+CV_REGISTER(ARM64_W17, 27)
+CV_REGISTER(ARM64_W18, 28)
+CV_REGISTER(ARM64_W19, 29)
+CV_REGISTER(ARM64_W20, 30)
+CV_REGISTER(ARM64_W21, 31)
+CV_REGISTER(ARM64_W22, 32)
+CV_REGISTER(ARM64_W23, 33)
+CV_REGISTER(ARM64_W24, 34)
+CV_REGISTER(ARM64_W25, 35)
+CV_REGISTER(ARM64_W26, 36)
+CV_REGISTER(ARM64_W27, 37)
+CV_REGISTER(ARM64_W28, 38)
+CV_REGISTER(ARM64_W29, 39)
+CV_REGISTER(ARM64_W30, 40)
+CV_REGISTER(ARM64_WZR, 41)
+
+// General purpose 64-bit integer registers
+
+CV_REGISTER(ARM64_X0, 50)
+CV_REGISTER(ARM64_X1, 51)
+CV_REGISTER(ARM64_X2, 52)
+CV_REGISTER(ARM64_X3, 53)
+CV_REGISTER(ARM64_X4, 54)
+CV_REGISTER(ARM64_X5, 55)
+CV_REGISTER(ARM64_X6, 56)
+CV_REGISTER(ARM64_X7, 57)
+CV_REGISTER(ARM64_X8, 58)
+CV_REGISTER(ARM64_X9, 59)
+CV_REGISTER(ARM64_X10, 60)
+CV_REGISTER(ARM64_X11, 61)
+CV_REGISTER(ARM64_X12, 62)
+CV_REGISTER(ARM64_X13, 63)
+CV_REGISTER(ARM64_X14, 64)
+CV_REGISTER(ARM64_X15, 65)
+CV_REGISTER(ARM64_X16, 66)
+CV_REGISTER(ARM64_X17, 67)
+CV_REGISTER(ARM64_X18, 68)
+CV_REGISTER(ARM64_X19, 69)
+CV_REGISTER(ARM64_X20, 70)
+CV_REGISTER(ARM64_X21, 71)
+CV_REGISTER(ARM64_X22, 72)
+CV_REGISTER(ARM64_X23, 73)
+CV_REGISTER(ARM64_X24, 74)
+CV_REGISTER(ARM64_X25, 75)
+CV_REGISTER(ARM64_X26, 76)
+CV_REGISTER(ARM64_X27, 77)
+CV_REGISTER(ARM64_X28, 78)
+CV_REGISTER(ARM64_FP, 79)
+CV_REGISTER(ARM64_LR, 80)
+CV_REGISTER(ARM64_SP, 81)
+CV_REGISTER(ARM64_ZR, 82)
+
+// status register
+
+CV_REGISTER(ARM64_NZCV, 90)
+
+// 32-bit floating point registers
+
+CV_REGISTER(ARM64_S0, 100)
+CV_REGISTER(ARM64_S1, 101)
+CV_REGISTER(ARM64_S2, 102)
+CV_REGISTER(ARM64_S3, 103)
+CV_REGISTER(ARM64_S4, 104)
+CV_REGISTER(ARM64_S5, 105)
+CV_REGISTER(ARM64_S6, 106)
+CV_REGISTER(ARM64_S7, 107)
+CV_REGISTER(ARM64_S8, 108)
+CV_REGISTER(ARM64_S9, 109)
+CV_REGISTER(ARM64_S10, 110)
+CV_REGISTER(ARM64_S11, 111)
+CV_REGISTER(ARM64_S12, 112)
+CV_REGISTER(ARM64_S13, 113)
+CV_REGISTER(ARM64_S14, 114)
+CV_REGISTER(ARM64_S15, 115)
+CV_REGISTER(ARM64_S16, 116)
+CV_REGISTER(ARM64_S17, 117)
+CV_REGISTER(ARM64_S18, 118)
+CV_REGISTER(ARM64_S19, 119)
+CV_REGISTER(ARM64_S20, 120)
+CV_REGISTER(ARM64_S21, 121)
+CV_REGISTER(ARM64_S22, 122)
+CV_REGISTER(ARM64_S23, 123)
+CV_REGISTER(ARM64_S24, 124)
+CV_REGISTER(ARM64_S25, 125)
+CV_REGISTER(ARM64_S26, 126)
+CV_REGISTER(ARM64_S27, 127)
+CV_REGISTER(ARM64_S28, 128)
+CV_REGISTER(ARM64_S29, 129)
+CV_REGISTER(ARM64_S30, 130)
+CV_REGISTER(ARM64_S31, 131)
+
+// 64-bit floating point registers
+
+CV_REGISTER(ARM64_D0, 140)
+CV_REGISTER(ARM64_D1, 141)
+CV_REGISTER(ARM64_D2, 142)
+CV_REGISTER(ARM64_D3, 143)
+CV_REGISTER(ARM64_D4, 144)
+CV_REGISTER(ARM64_D5, 145)
+CV_REGISTER(ARM64_D6, 146)
+CV_REGISTER(ARM64_D7, 147)
+CV_REGISTER(ARM64_D8, 148)
+CV_REGISTER(ARM64_D9, 149)
+CV_REGISTER(ARM64_D10, 150)
+CV_REGISTER(ARM64_D11, 151)
+CV_REGISTER(ARM64_D12, 152)
+CV_REGISTER(ARM64_D13, 153)
+CV_REGISTER(ARM64_D14, 154)
+CV_REGISTER(ARM64_D15, 155)
+CV_REGISTER(ARM64_D16, 156)
+CV_REGISTER(ARM64_D17, 157)
+CV_REGISTER(ARM64_D18, 158)
+CV_REGISTER(ARM64_D19, 159)
+CV_REGISTER(ARM64_D20, 160)
+CV_REGISTER(ARM64_D21, 161)
+CV_REGISTER(ARM64_D22, 162)
+CV_REGISTER(ARM64_D23, 163)
+CV_REGISTER(ARM64_D24, 164)
+CV_REGISTER(ARM64_D25, 165)
+CV_REGISTER(ARM64_D26, 166)
+CV_REGISTER(ARM64_D27, 167)
+CV_REGISTER(ARM64_D28, 168)
+CV_REGISTER(ARM64_D29, 169)
+CV_REGISTER(ARM64_D30, 170)
+CV_REGISTER(ARM64_D31, 171)
+
+// 128-bit SIMD registers
+
+CV_REGISTER(ARM64_Q0, 180)
+CV_REGISTER(ARM64_Q1, 181)
+CV_REGISTER(ARM64_Q2, 182)
+CV_REGISTER(ARM64_Q3, 183)
+CV_REGISTER(ARM64_Q4, 184)
+CV_REGISTER(ARM64_Q5, 185)
+CV_REGISTER(ARM64_Q6, 186)
+CV_REGISTER(ARM64_Q7, 187)
+CV_REGISTER(ARM64_Q8, 188)
+CV_REGISTER(ARM64_Q9, 189)
+CV_REGISTER(ARM64_Q10, 190)
+CV_REGISTER(ARM64_Q11, 191)
+CV_REGISTER(ARM64_Q12, 192)
+CV_REGISTER(ARM64_Q13, 193)
+CV_REGISTER(ARM64_Q14, 194)
+CV_REGISTER(ARM64_Q15, 195)
+CV_REGISTER(ARM64_Q16, 196)
+CV_REGISTER(ARM64_Q17, 197)
+CV_REGISTER(ARM64_Q18, 198)
+CV_REGISTER(ARM64_Q19, 199)
+CV_REGISTER(ARM64_Q20, 200)
+CV_REGISTER(ARM64_Q21, 201)
+CV_REGISTER(ARM64_Q22, 202)
+CV_REGISTER(ARM64_Q23, 203)
+CV_REGISTER(ARM64_Q24, 204)
+CV_REGISTER(ARM64_Q25, 205)
+CV_REGISTER(ARM64_Q26, 206)
+CV_REGISTER(ARM64_Q27, 207)
+CV_REGISTER(ARM64_Q28, 208)
+CV_REGISTER(ARM64_Q29, 209)
+CV_REGISTER(ARM64_Q30, 210)
+CV_REGISTER(ARM64_Q31, 211)
+
+// Floating point status register
+
+CV_REGISTER(ARM64_FPSR, 220)
+
+#endif // defined(CV_REGISTERS_ALL) || defined(CV_REGISTERS_ARM64)
diff --git a/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def b/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def
index b5f1cc0198dc..4f8ccfdd16af 100644
--- a/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def
+++ b/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def
@@ -1,9 +1,8 @@
//===-- CodeViewSymbols.def - All CodeView leaf types -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -103,7 +102,6 @@ CV_SYMBOL(S_LPROCIA64_ST , 0x1015)
CV_SYMBOL(S_GPROCIA64_ST , 0x1016)
CV_SYMBOL(S_LOCALSLOT_ST , 0x1017)
CV_SYMBOL(S_PARAMSLOT_ST , 0x1018)
-CV_SYMBOL(S_ANNOTATION , 0x1019)
CV_SYMBOL(S_GMANPROC_ST , 0x101a)
CV_SYMBOL(S_LMANPROC_ST , 0x101b)
CV_SYMBOL(S_RESERVED1 , 0x101c)
@@ -255,6 +253,7 @@ SYMBOL_RECORD(S_LTHREAD32 , 0x1112, ThreadLocalDataSym)
SYMBOL_RECORD_ALIAS(S_GTHREAD32 , 0x1113, GlobalTLS, ThreadLocalDataSym)
SYMBOL_RECORD(S_UNAMESPACE , 0x1124, UsingNamespaceSym)
+SYMBOL_RECORD(S_ANNOTATION , 0x1019, AnnotationSym)
#undef CV_SYMBOL
#undef SYMBOL_RECORD
diff --git a/include/llvm/DebugInfo/CodeView/CodeViewTypes.def b/include/llvm/DebugInfo/CodeView/CodeViewTypes.def
index e9a479dba496..a31111eb80a4 100644
--- a/include/llvm/DebugInfo/CodeView/CodeViewTypes.def
+++ b/include/llvm/DebugInfo/CodeView/CodeViewTypes.def
@@ -1,9 +1,8 @@
//===-- CodeViewTypes.def - All CodeView leaf types -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
index 7f851a2595dc..53ab2dd04aa7 100644
--- a/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
+++ b/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
@@ -1,9 +1,8 @@
//===- ContinuationRecordBuilder.h ------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -62,4 +61,4 @@ public:
} // namespace codeview
} // namespace llvm
-#endif \ No newline at end of file
+#endif
diff --git a/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h b/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
index 78b284563afd..01f83676afdf 100644
--- a/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
@@ -1,9 +1,8 @@
//===- DebugChecksumsSubsection.h -------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h b/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
index 2f9e9814d998..64a78a7cef21 100644
--- a/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
@@ -1,9 +1,8 @@
//===- DebugCrossExSubsection.h ---------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h b/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
index 8be7ef265c82..e7683cb2a9c4 100644
--- a/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
@@ -1,9 +1,8 @@
-//===- DebugCrossExSubsection.h ---------------------------------*- C++ -*-===//
+//===- DebugCrossImpSubsection.h --------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h b/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
index 847d93f0e985..d5cd640231f9 100644
--- a/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
@@ -1,9 +1,8 @@
//===- DebugFrameDataSubsection.h ------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h b/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
index b88c0eae1de2..9fd88a64873a 100644
--- a/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
@@ -1,9 +1,8 @@
//===- DebugInlineeLinesSubsection.h ----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -71,6 +70,11 @@ public:
}
Error initialize(BinaryStreamReader Reader);
+ Error initialize(BinaryStreamRef Section) {
+ return initialize(BinaryStreamReader(Section));
+ }
+
+ bool valid() const { return Lines.valid(); }
bool hasExtraFiles() const;
Iterator begin() const { return Lines.begin(); }
@@ -78,7 +82,7 @@ public:
private:
InlineeLinesSignature Signature;
- VarStreamArray<InlineeSourceLine> Lines;
+ LinesArray Lines;
};
class DebugInlineeLinesSubsection final : public DebugSubsection {
diff --git a/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h b/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
index 53044b6c3dc8..1f8e56c5311f 100644
--- a/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
@@ -1,9 +1,8 @@
//===- DebugLinesSubsection.h -----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h b/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
index bebc960223cc..6e5b8adddd4a 100644
--- a/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
@@ -1,9 +1,8 @@
//===- DebugStringTableSubsection.h - CodeView String Table -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugSubsection.h b/include/llvm/DebugInfo/CodeView/DebugSubsection.h
index e427e0006a55..66272870efda 100644
--- a/include/llvm/DebugInfo/CodeView/DebugSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugSubsection.h
@@ -1,9 +1,8 @@
//===- DebugSubsection.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h b/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
index fc0cf0d1d90e..bcb379f00d68 100644
--- a/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
+++ b/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
@@ -1,9 +1,8 @@
//===- DebugSubsectionRecord.h ----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h b/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
index 75f749dfa933..720b1b49581f 100644
--- a/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
+++ b/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
@@ -1,9 +1,8 @@
//===- DebugSubsectionVisitor.h -----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h b/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
index a4c04b55eb4c..91b740ce6b9a 100644
--- a/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
@@ -1,9 +1,8 @@
//===- DebugSymbolRVASubsection.h -------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h b/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
index dfda7deb6cb4..784fc59484b9 100644
--- a/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
@@ -1,9 +1,8 @@
//===- DebugSymbolsSubsection.h --------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h b/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
index ea9a96ca8d68..fa7df325499f 100644
--- a/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
+++ b/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
@@ -1,9 +1,8 @@
//===- DebugUnknownSubsection.h -----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/EnumTables.h b/include/llvm/DebugInfo/CodeView/EnumTables.h
index ee0f0f7c6023..ed126ed9e2ff 100644
--- a/include/llvm/DebugInfo/CodeView/EnumTables.h
+++ b/include/llvm/DebugInfo/CodeView/EnumTables.h
@@ -1,9 +1,8 @@
//===- EnumTables.h - Enum to string conversion tables ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -21,7 +20,7 @@ namespace codeview {
ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames();
ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames();
-ArrayRef<EnumEntry<uint16_t>> getRegisterNames();
+ArrayRef<EnumEntry<uint16_t>> getRegisterNames(CPUType Cpu);
ArrayRef<EnumEntry<uint32_t>> getPublicSymFlagNames();
ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames();
ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames();
diff --git a/include/llvm/DebugInfo/CodeView/Formatters.h b/include/llvm/DebugInfo/CodeView/Formatters.h
index 278ad02a39cd..7d04a6a89bef 100644
--- a/include/llvm/DebugInfo/CodeView/Formatters.h
+++ b/include/llvm/DebugInfo/CodeView/Formatters.h
@@ -1,9 +1,8 @@
//===- Formatters.h ---------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/FunctionId.h b/include/llvm/DebugInfo/CodeView/FunctionId.h
index 1af3da810b5a..bc102278819c 100644
--- a/include/llvm/DebugInfo/CodeView/FunctionId.h
+++ b/include/llvm/DebugInfo/CodeView/FunctionId.h
@@ -1,9 +1,8 @@
//===- FunctionId.h ---------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/GUID.h b/include/llvm/DebugInfo/CodeView/GUID.h
index a055ce9e2e45..5f807e6f7eeb 100644
--- a/include/llvm/DebugInfo/CodeView/GUID.h
+++ b/include/llvm/DebugInfo/CodeView/GUID.h
@@ -1,9 +1,8 @@
//===- GUID.h ---------------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h b/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
index c4704168ed34..a43ce20edde6 100644
--- a/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
+++ b/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
@@ -1,9 +1,8 @@
//===- GlobalTypeTableBuilder.h ----------------------------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -74,14 +73,30 @@ public:
CreateFunc Create) {
auto Result = HashedRecords.try_emplace(Hash, nextTypeIndex());
- if (LLVM_UNLIKELY(Result.second)) {
+ if (LLVM_UNLIKELY(Result.second /*inserted*/ ||
+ Result.first->second.isSimple())) {
uint8_t *Stable = RecordStorage.Allocate<uint8_t>(RecordSize);
MutableArrayRef<uint8_t> Data(Stable, RecordSize);
- SeenRecords.push_back(Create(Data));
+ ArrayRef<uint8_t> StableRecord = Create(Data);
+ if (StableRecord.empty()) {
+ // Records with forward references into the Type stream will be deferred
+ // for insertion at a later time, on the second pass.
+ Result.first->getSecond() = TypeIndex(SimpleTypeKind::NotTranslated);
+ return TypeIndex(SimpleTypeKind::NotTranslated);
+ }
+ if (Result.first->second.isSimple()) {
+ assert(Result.first->second.getIndex() ==
+ (uint32_t)SimpleTypeKind::NotTranslated);
+ // On the second pass, update with index to remapped record. The
+ // (initially misbehaved) record will now come *after* other records
+ // resolved in the first pass, with proper *back* references in the
+ // stream.
+ Result.first->second = nextTypeIndex();
+ }
+ SeenRecords.push_back(StableRecord);
SeenHashes.push_back(Hash);
}
- // Update the caller's copy of Record to point a stable copy.
return Result.first->second;
}
diff --git a/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h b/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
index 383f7dd9fb6a..4e03627e9580 100644
--- a/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
+++ b/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
@@ -1,9 +1,8 @@
//===- LazyRandomTypeCollection.h -------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/Line.h b/include/llvm/DebugInfo/CodeView/Line.h
index ac229c337513..eb2aa154df1b 100644
--- a/include/llvm/DebugInfo/CodeView/Line.h
+++ b/include/llvm/DebugInfo/CodeView/Line.h
@@ -1,9 +1,8 @@
//===- Line.h ---------------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h b/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
index 9030918ebbb3..1b2f6d29a9b6 100644
--- a/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
+++ b/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
@@ -1,9 +1,8 @@
//===- MergingTypeTableBuilder.h ---------------------------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/RecordName.h b/include/llvm/DebugInfo/CodeView/RecordName.h
index b022108df3d6..cc09db8933bd 100644
--- a/include/llvm/DebugInfo/CodeView/RecordName.h
+++ b/include/llvm/DebugInfo/CodeView/RecordName.h
@@ -1,9 +1,8 @@
//===- RecordName.h ------------------------------------------- *- C++ --*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/RecordSerialization.h b/include/llvm/DebugInfo/CodeView/RecordSerialization.h
index 36237e1a4d9e..36c0f2fbd8fa 100644
--- a/include/llvm/DebugInfo/CodeView/RecordSerialization.h
+++ b/include/llvm/DebugInfo/CodeView/RecordSerialization.h
@@ -1,9 +1,8 @@
//===- RecordSerialization.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -32,6 +31,9 @@ using llvm::support::ulittle32_t;
enum : unsigned { MaxRecordLength = 0xFF00 };
struct RecordPrefix {
+ RecordPrefix() = default;
+ explicit RecordPrefix(uint16_t Kind) : RecordLen(2), RecordKind(Kind) {}
+
ulittle16_t RecordLen; // Record length, starting from &RecordKind.
ulittle16_t RecordKind; // Record kind enum (SymRecordKind or TypeRecordKind)
};
diff --git a/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h b/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
index a85d9270186b..3ca09b445a30 100644
--- a/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
+++ b/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
@@ -1,9 +1,8 @@
//===- SimpleTypeSerializer.h -----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h b/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
index 22a333e631a0..22a283e785e1 100644
--- a/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
+++ b/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
@@ -1,9 +1,8 @@
//===- StringsAndChecksums.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h b/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
index 6b5dd2d20d17..62761cb87c81 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
@@ -1,9 +1,8 @@
//===- SymbolDeserializer.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h b/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
index 823636c398de..12f45dcb21ff 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
@@ -1,9 +1,8 @@
//===-- SymbolDumpDelegate.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolDumper.h b/include/llvm/DebugInfo/CodeView/SymbolDumper.h
index 215da2e2b522..d832a48b1265 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolDumper.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolDumper.h
@@ -1,9 +1,8 @@
//===-- SymbolDumper.h - CodeView symbol info dumper ------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolRecord.h b/include/llvm/DebugInfo/CodeView/SymbolRecord.h
index b58825c4a788..5e9a7432b9b6 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolRecord.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolRecord.h
@@ -1,9 +1,8 @@
//===- SymbolRecord.h -------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -14,6 +13,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
@@ -156,15 +156,19 @@ public:
uint32_t RecordOffset;
};
-struct BinaryAnnotationIterator {
- struct AnnotationData {
- BinaryAnnotationsOpCode OpCode;
- StringRef Name;
- uint32_t U1;
- uint32_t U2;
- int32_t S1;
- };
+struct DecodedAnnotation {
+ StringRef Name;
+ ArrayRef<uint8_t> Bytes;
+ BinaryAnnotationsOpCode OpCode;
+ uint32_t U1 = 0;
+ uint32_t U2 = 0;
+ int32_t S1 = 0;
+};
+struct BinaryAnnotationIterator
+ : public iterator_facade_base<BinaryAnnotationIterator,
+ std::forward_iterator_tag,
+ DecodedAnnotation> {
BinaryAnnotationIterator() = default;
BinaryAnnotationIterator(ArrayRef<uint8_t> Annotations) : Data(Annotations) {}
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
@@ -174,10 +178,6 @@ struct BinaryAnnotationIterator {
return Data == Other.Data;
}
- bool operator!=(const BinaryAnnotationIterator &Other) const {
- return !(*this == Other);
- }
-
BinaryAnnotationIterator &operator=(const BinaryAnnotationIterator Other) {
Data = Other.Data;
return *this;
@@ -194,13 +194,7 @@ struct BinaryAnnotationIterator {
return *this;
}
- BinaryAnnotationIterator operator++(int) {
- BinaryAnnotationIterator Orig(*this);
- ++(*this);
- return Orig;
- }
-
- const AnnotationData &operator*() {
+ const DecodedAnnotation &operator*() {
ParseCurrentAnnotation();
return Current.getValue();
}
@@ -242,17 +236,17 @@ private:
(ThirdByte << 8) | FourthByte;
return -1;
- };
+ }
static int32_t DecodeSignedOperand(uint32_t Operand) {
if (Operand & 1)
return -(Operand >> 1);
return Operand >> 1;
- };
+ }
static int32_t DecodeSignedOperand(ArrayRef<uint8_t> &Annotations) {
return DecodeSignedOperand(GetCompressedAnnotation(Annotations));
- };
+ }
bool ParseCurrentAnnotation() {
if (Current.hasValue())
@@ -260,7 +254,7 @@ private:
Next = Data;
uint32_t Op = GetCompressedAnnotation(Next);
- AnnotationData Result;
+ DecodedAnnotation Result;
Result.OpCode = static_cast<BinaryAnnotationsOpCode>(Op);
switch (Result.OpCode) {
case BinaryAnnotationsOpCode::Invalid:
@@ -325,11 +319,12 @@ private:
break;
}
}
+ Result.Bytes = Data.take_front(Data.size() - Next.size());
Current = Result;
return true;
}
- Optional<AnnotationData> Current;
+ Optional<DecodedAnnotation> Current;
ArrayRef<uint8_t> Data;
ArrayRef<uint8_t> Next;
};
@@ -974,7 +969,7 @@ class UsingNamespaceSym : public SymbolRecord {
public:
explicit UsingNamespaceSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
explicit UsingNamespaceSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::RegRelativeSym),
+ : SymbolRecord(SymbolRecordKind::UsingNamespaceSym),
RecordOffset(RecordOffset) {}
StringRef Name;
@@ -983,6 +978,19 @@ public:
};
// S_ANNOTATION
+class AnnotationSym : public SymbolRecord {
+public:
+ explicit AnnotationSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
+ explicit AnnotationSym(uint32_t RecordOffset)
+ : SymbolRecord(SymbolRecordKind::AnnotationSym),
+ RecordOffset(RecordOffset) {}
+
+ uint32_t CodeOffset = 0;
+ uint16_t Segment = 0;
+ std::vector<StringRef> Strings;
+
+ uint32_t RecordOffset;
+};
using CVSymbol = CVRecord<SymbolKind>;
using CVSymbolArray = VarStreamArray<CVSymbol>;
diff --git a/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h b/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
index 3713fe118eaa..57dbc56c0769 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
@@ -1,9 +1,8 @@
//===- SymbolRecordHelpers.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h b/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
index 391e8f127665..34368b6185d6 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
@@ -1,9 +1,8 @@
//===- SymbolRecordMapping.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolSerializer.h b/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
index f4d8ab0c3c2e..b805b6595e80 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
@@ -1,9 +1,8 @@
//===- SymbolSerializer.h ---------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -52,8 +51,8 @@ public:
template <typename SymType>
static CVSymbol writeOneSymbol(SymType &Sym, BumpPtrAllocator &Storage,
CodeViewContainer Container) {
- CVSymbol Result;
- Result.Type = static_cast<SymbolKind>(Sym.Kind);
+ RecordPrefix Prefix{uint16_t(Sym.Kind)};
+ CVSymbol Result(&Prefix, sizeof(Prefix));
SymbolSerializer Serializer(Storage, Container);
consumeError(Serializer.visitSymbolBegin(Result));
consumeError(Serializer.visitKnownRecord(Result, Sym));
diff --git a/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h b/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
index e29511a67b7f..145d63a6fe61 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
@@ -1,9 +1,8 @@
//===- SymbolVisitorCallbackPipeline.h --------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h b/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
index 0816f7c62656..1a4d5b9d31df 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
@@ -1,9 +1,8 @@
//===- SymbolVisitorCallbacks.h ---------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h b/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
index a2a3c6f18fba..368d8b288315 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
@@ -1,9 +1,8 @@
//===-- SymbolVisitorDelegate.h ---------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeCollection.h b/include/llvm/DebugInfo/CodeView/TypeCollection.h
index e9fc9b0de8ef..58b1dd058c1a 100644
--- a/include/llvm/DebugInfo/CodeView/TypeCollection.h
+++ b/include/llvm/DebugInfo/CodeView/TypeCollection.h
@@ -1,9 +1,8 @@
//===- TypeCollection.h - A collection of CodeView type records -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeDeserializer.h b/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
index 9887d901773a..081de32dd02c 100644
--- a/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
+++ b/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
@@ -1,9 +1,8 @@
//===- TypeDeserializer.h ---------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -59,7 +58,7 @@ public:
TypeRecordKind K =
static_cast<TypeRecordKind>(uint16_t(Prefix->RecordKind));
T Record(K);
- CVType CVT(static_cast<TypeLeafKind>(K), Data);
+ CVType CVT(Data);
if (auto EC = deserializeAs<T>(CVT, Record))
return std::move(EC);
return Record;
@@ -112,14 +111,14 @@ class FieldListDeserializer : public TypeVisitorCallbacks {
public:
explicit FieldListDeserializer(BinaryStreamReader &Reader) : Mapping(Reader) {
- CVType FieldList;
- FieldList.Type = TypeLeafKind::LF_FIELDLIST;
+ RecordPrefix Pre(static_cast<uint16_t>(TypeLeafKind::LF_FIELDLIST));
+ CVType FieldList(&Pre, sizeof(Pre));
consumeError(Mapping.Mapping.visitTypeBegin(FieldList));
}
~FieldListDeserializer() override {
- CVType FieldList;
- FieldList.Type = TypeLeafKind::LF_FIELDLIST;
+ RecordPrefix Pre(static_cast<uint16_t>(TypeLeafKind::LF_FIELDLIST));
+ CVType FieldList(&Pre, sizeof(Pre));
consumeError(Mapping.Mapping.visitTypeEnd(FieldList));
}
diff --git a/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h b/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
index afb8b3636361..41a219ae5a7b 100644
--- a/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
+++ b/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
@@ -1,9 +1,8 @@
//===-- TypeDumpVisitor.h - CodeView type info dumper -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeHashing.h b/include/llvm/DebugInfo/CodeView/TypeHashing.h
index 1f732d29a538..b0a16cccbff3 100644
--- a/include/llvm/DebugInfo/CodeView/TypeHashing.h
+++ b/include/llvm/DebugInfo/CodeView/TypeHashing.h
@@ -1,9 +1,8 @@
//===- TypeHashing.h ---------------------------------------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -85,6 +84,8 @@ struct GloballyHashedType {
}
std::array<uint8_t, 8> Hash;
+ bool empty() const { return *(const uint64_t*)Hash.data() == 0; }
+
/// Given a sequence of bytes representing a record, compute a global hash for
/// this record. Due to the nature of global hashes incorporating the hashes
/// of referenced records, this function requires a list of types and ids
@@ -108,8 +109,33 @@ struct GloballyHashedType {
template <typename Range>
static std::vector<GloballyHashedType> hashTypes(Range &&Records) {
std::vector<GloballyHashedType> Hashes;
- for (const auto &R : Records)
- Hashes.push_back(hashType(R, Hashes, Hashes));
+ bool UnresolvedRecords = false;
+ for (const auto &R : Records) {
+ GloballyHashedType H = hashType(R, Hashes, Hashes);
+ if (H.empty())
+ UnresolvedRecords = true;
+ Hashes.push_back(H);
+ }
+
+ // In some rare cases, there might be records with forward references in the
+ // stream. Several passes might be needed to fully hash each record in the
+ // Type stream. However this occurs on very small OBJs generated by MASM,
+ // with a dozen records at most. Therefore this codepath isn't
+ // time-critical, as it isn't taken in 99% of cases.
+ while (UnresolvedRecords) {
+ UnresolvedRecords = false;
+ auto HashIt = Hashes.begin();
+ for (const auto &R : Records) {
+ if (HashIt->empty()) {
+ GloballyHashedType H = hashType(R, Hashes, Hashes);
+ if (H.empty())
+ UnresolvedRecords = true;
+ else
+ *HashIt = H;
+ }
+ ++HashIt;
+ }
+ }
return Hashes;
}
diff --git a/include/llvm/DebugInfo/CodeView/TypeIndex.h b/include/llvm/DebugInfo/CodeView/TypeIndex.h
index 58463a6b13df..b9e2562bfc2b 100644
--- a/include/llvm/DebugInfo/CodeView/TypeIndex.h
+++ b/include/llvm/DebugInfo/CodeView/TypeIndex.h
@@ -1,9 +1,8 @@
//===- TypeIndex.h ----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h b/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
index c424a09ece89..469768787274 100644
--- a/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
+++ b/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
@@ -1,9 +1,8 @@
//===- TypeIndexDiscovery.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeRecord.h b/include/llvm/DebugInfo/CodeView/TypeRecord.h
index 7b4a30ee622d..b147dd6c3d05 100644
--- a/include/llvm/DebugInfo/CodeView/TypeRecord.h
+++ b/include/llvm/DebugInfo/CodeView/TypeRecord.h
@@ -1,9 +1,8 @@
//===- TypeRecord.h ---------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h b/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
index 389472ed1aea..e84704d99ddc 100644
--- a/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
+++ b/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
@@ -1,9 +1,8 @@
//===- TypeRecordHelpers.h --------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h b/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
index cbe8d6066bb9..4c309c10ff0c 100644
--- a/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
+++ b/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
@@ -1,9 +1,8 @@
//===- TypeRecordMapping.h --------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -24,9 +23,11 @@ class TypeRecordMapping : public TypeVisitorCallbacks {
public:
explicit TypeRecordMapping(BinaryStreamReader &Reader) : IO(Reader) {}
explicit TypeRecordMapping(BinaryStreamWriter &Writer) : IO(Writer) {}
+ explicit TypeRecordMapping(CodeViewRecordStreamer &Streamer) : IO(Streamer) {}
using TypeVisitorCallbacks::visitTypeBegin;
Error visitTypeBegin(CVType &Record) override;
+ Error visitTypeBegin(CVType &Record, TypeIndex Index) override;
Error visitTypeEnd(CVType &Record) override;
Error visitMemberBegin(CVMemberRecord &Record) override;
diff --git a/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h b/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
index 0b9f54ec60bf..d0506cce8176 100644
--- a/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
+++ b/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
@@ -1,9 +1,8 @@
//===- TypeStreamMerger.h ---------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h b/include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
index dfba83d62fce..4f2e5deb10b4 100644
--- a/include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
+++ b/include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
@@ -1,9 +1,8 @@
//===- TypeSymbolEmitter.h --------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeTableCollection.h b/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
index 80326a0ffd39..5cbe3400e029 100644
--- a/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
+++ b/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
@@ -1,9 +1,8 @@
//===- TypeTableCollection.h ---------------------------------- *- C++ --*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h b/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
index 126fb8abb0da..169715be2d52 100644
--- a/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
+++ b/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
@@ -1,9 +1,8 @@
//===- TypeVisitorCallbackPipeline.h ----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -83,6 +82,11 @@ public:
Pipeline.push_back(&Callbacks);
}
+ void addCallbackToPipelineFront(TypeVisitorCallbacks &Callbacks) {
+ auto CallBackItr = Pipeline.begin();
+ Pipeline.insert(CallBackItr, &Callbacks);
+ }
+
#define TYPE_RECORD(EnumName, EnumVal, Name) \
Error visitKnownRecord(CVType &CVR, Name##Record &Record) override { \
return visitKnownRecordImpl(CVR, Record); \
diff --git a/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h b/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
index d7a473306bc2..33f8b1f24b1b 100644
--- a/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
+++ b/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
@@ -1,9 +1,8 @@
//===- TypeVisitorCallbacks.h -----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h
index 85e96402a246..d2a5318179eb 100644
--- a/include/llvm/DebugInfo/DIContext.h
+++ b/include/llvm/DebugInfo/DIContext.h
@@ -1,9 +1,8 @@
//===- DIContext.h ----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -98,11 +97,10 @@ public:
void addFrame(const DILineInfo &Frame) {
Frames.push_back(Frame);
}
-
+
void resize(unsigned i) {
Frames.resize(i);
}
-
};
/// Container for description of a global variable.
@@ -114,6 +112,16 @@ struct DIGlobal {
DIGlobal() : Name("<invalid>") {}
};
+struct DILocal {
+ std::string FunctionName;
+ std::string Name;
+ std::string DeclFile;
+ uint64_t DeclLine = 0;
+ Optional<int64_t> FrameOffset;
+ Optional<uint64_t> Size;
+ Optional<uint64_t> TagOffset;
+};
+
/// A DINameKind is passed to name search methods to specify a
/// preference regarding the type of name resolution the caller wants.
enum class DINameKind { None, ShortName, LinkageName };
@@ -158,7 +166,8 @@ enum DIDumpType : unsigned {
/// dumped.
struct DIDumpOptions {
unsigned DumpType = DIDT_All;
- unsigned RecurseDepth = -1U;
+ unsigned ChildRecurseDepth = -1U;
+ unsigned ParentRecurseDepth = -1U;
uint16_t Version = 0; // DWARF version to assume when extracting.
uint8_t AddrSize = 4; // Address byte size to assume when extracting.
bool ShowAddresses = true;
@@ -172,15 +181,18 @@ struct DIDumpOptions {
/// Return default option set for printing a single DIE without children.
static DIDumpOptions getForSingleDIE() {
DIDumpOptions Opts;
- Opts.RecurseDepth = 0;
+ Opts.ChildRecurseDepth = 0;
+ Opts.ParentRecurseDepth = 0;
return Opts;
}
/// Return the options with RecurseDepth set to 0 unless explicitly required.
DIDumpOptions noImplicitRecursion() const {
DIDumpOptions Opts = *this;
- if (RecurseDepth == -1U && !ShowChildren)
- Opts.RecurseDepth = 0;
+ if (ChildRecurseDepth == -1U && !ShowChildren)
+ Opts.ChildRecurseDepth = 0;
+ if (ParentRecurseDepth == -1U && !ShowParents)
+ Opts.ParentRecurseDepth = 0;
return Opts;
}
};
@@ -204,12 +216,18 @@ public:
return true;
}
- virtual DILineInfo getLineInfoForAddress(uint64_t Address,
+ virtual DILineInfo getLineInfoForAddress(
+ object::SectionedAddress Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
- virtual DILineInfoTable getLineInfoForAddressRange(uint64_t Address,
- uint64_t Size, DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
- virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address,
+ virtual DILineInfoTable getLineInfoForAddressRange(
+ object::SectionedAddress Address, uint64_t Size,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
+ virtual DIInliningInfo getInliningInfoForAddress(
+ object::SectionedAddress Address,
+ DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
+
+ virtual std::vector<DILocal>
+ getLocalsForAddress(object::SectionedAddress Address) = 0;
private:
const DIContextKind Kind;
diff --git a/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h b/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
index 84b23398b8cc..ccf2891c2e21 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
@@ -1,9 +1,8 @@
//===- DWARFAbbreviationDeclaration.h ---------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h b/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
index 1d448728338f..303375703d2e 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
@@ -1,9 +1,8 @@
//===- DWARFAcceleratorTable.h ----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -72,7 +71,7 @@ public:
: AccelSection(AccelSection), StringSection(StringSection) {}
virtual ~DWARFAcceleratorTable();
- virtual llvm::Error extract() = 0;
+ virtual Error extract() = 0;
virtual void dump(raw_ostream &OS) const = 0;
DWARFAcceleratorTable(const DWARFAcceleratorTable &) = delete;
@@ -175,7 +174,7 @@ public:
DataExtractor StringSection)
: DWARFAcceleratorTable(AccelSection, StringSection) {}
- llvm::Error extract() override;
+ Error extract() override;
uint32_t getNumBuckets();
uint32_t getNumHashes();
uint32_t getSizeHdr();
@@ -223,7 +222,7 @@ public:
/// referenced by the name table and interpreted with the help of the
/// abbreviation table.
class DWARFDebugNames : public DWARFAcceleratorTable {
- /// The fixed-size part of a Dwarf 5 Name Index header
+ /// The fixed-size part of a DWARF v5 Name Index header
struct HeaderPOD {
uint32_t UnitLength;
uint16_t Version;
@@ -242,7 +241,7 @@ public:
class NameIterator;
class ValueIterator;
- /// Dwarf 5 Name Index header.
+ /// DWARF v5 Name Index header.
struct Header : public HeaderPOD {
SmallString<8> AugmentationString;
@@ -349,7 +348,7 @@ private:
};
public:
- /// A single entry in the Name Table (Dwarf 5 sect. 6.1.1.4.6) of the Name
+ /// A single entry in the Name Table (DWARF v5 sect. 6.1.1.4.6) of the Name
/// Index.
class NameTableEntry {
DataExtractor StrData;
@@ -381,7 +380,7 @@ public:
uint32_t getEntryOffset() const { return EntryOffset; }
};
- /// Represents a single accelerator table within the Dwarf 5 .debug_names
+ /// Represents a single accelerator table within the DWARF v5 .debug_names
/// section.
class NameIndex {
DenseSet<Abbrev, AbbrevMapInfo> Abbrevs;
@@ -460,7 +459,7 @@ public:
NameIterator begin() const { return NameIterator(this, 1); }
NameIterator end() const { return NameIterator(this, getNameCount() + 1); }
- llvm::Error extract();
+ Error extract();
uint32_t getUnitOffset() const { return Base; }
uint32_t getNextUnitOffset() const { return Base + 4 + Hdr.UnitLength; }
void dump(ScopedPrinter &W) const;
@@ -580,7 +579,7 @@ public:
DataExtractor StringSection)
: DWARFAcceleratorTable(AccelSection, StringSection) {}
- llvm::Error extract() override;
+ Error extract() override;
void dump(raw_ostream &OS) const override;
/// Look up all entries in the accelerator table matching \c Key.
diff --git a/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h b/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
index 5a7df5c353e8..2d5f9f3c7658 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
@@ -1,9 +1,8 @@
//===- DWARFAddressRange.h --------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -43,12 +42,6 @@ struct DWARFAddressRange {
return LowPC < RHS.HighPC && RHS.LowPC < HighPC;
}
- /// Returns true if [LowPC, HighPC) fully contains [RHS.LowPC, RHS.HighPC).
- bool contains(const DWARFAddressRange &RHS) const {
- assert(valid() && RHS.valid());
- return LowPC <= RHS.LowPC && RHS.HighPC <= HighPC;
- }
-
void dump(raw_ostream &OS, uint32_t AddressSize,
DIDumpOptions DumpOpts = {}) const;
};
diff --git a/include/llvm/DebugInfo/DWARF/DWARFAttribute.h b/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
index f0672bb0ca75..c8ad19ad6bf6 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
@@ -1,9 +1,8 @@
//===- DWARFAttribute.h -----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -28,13 +27,10 @@ struct DWARFAttribute {
/// The debug info/types section byte size of the data for this attribute.
uint32_t ByteSize = 0;
/// The attribute enumeration of this attribute.
- dwarf::Attribute Attr;
+ dwarf::Attribute Attr = dwarf::Attribute(0);
/// The form and value for this attribute.
DWARFFormValue Value;
- DWARFAttribute(uint32_t O, dwarf::Attribute A = dwarf::Attribute(0),
- dwarf::Form F = dwarf::Form(0)) : Attr(A), Value(F) {}
-
bool isValid() const {
return Offset != 0 && Attr != dwarf::Attribute(0);
}
@@ -43,12 +39,9 @@ struct DWARFAttribute {
return isValid();
}
- void clear() {
- Offset = 0;
- ByteSize = 0;
- Attr = dwarf::Attribute(0);
- Value = DWARFFormValue();
- }
+ /// Identifies DWARF attributes that may contain a reference to a
+ /// DWARF expression.
+ static bool mayHaveLocationDescription(dwarf::Attribute Attr);
};
} // end namespace llvm
diff --git a/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h b/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
index 33797419a7b8..16b9bfb5de56 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
@@ -1,9 +1,8 @@
//===- DWARFCompileUnit.h ---------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFContext.h b/include/llvm/DebugInfo/DWARF/DWARFContext.h
index dbb6be04544b..23cf21c3523f 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -1,9 +1,8 @@
//===- DWARFContext.h -------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===/
@@ -318,15 +317,23 @@ public:
/// Get the compilation unit, the function DIE and lexical block DIE for the
/// given address where applicable.
+ /// TODO: change input parameter from "uint64_t Address"
+ /// into "SectionedAddress Address"
DIEsForAddress getDIEsForAddress(uint64_t Address);
- DILineInfo getLineInfoForAddress(uint64_t Address,
+ DILineInfo getLineInfoForAddress(
+ object::SectionedAddress Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
- DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size,
+ DILineInfoTable getLineInfoForAddressRange(
+ object::SectionedAddress Address, uint64_t Size,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
- DIInliningInfo getInliningInfoForAddress(uint64_t Address,
+ DIInliningInfo getInliningInfoForAddress(
+ object::SectionedAddress Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
+ std::vector<DILocal>
+ getLocalsForAddress(object::SectionedAddress Address) override;
+
bool isLittleEndian() const { return DObj->isLittleEndian(); }
static bool isSupportedVersion(unsigned version) {
return version == 2 || version == 3 || version == 4 || version == 5;
@@ -367,7 +374,11 @@ public:
private:
/// Return the compile unit which contains instruction with provided
/// address.
+ /// TODO: change input parameter from "uint64_t Address"
+ /// into "SectionedAddress Address"
DWARFCompileUnit *getCompileUnitForAddress(uint64_t Address);
+ void addLocalsForDie(DWARFCompileUnit *CU, DWARFDie Subprogram, DWARFDie Die,
+ std::vector<DILocal> &Result);
};
} // end namespace llvm
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h b/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
index 1ed087520b30..7c2a159b71fa 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
@@ -1,9 +1,8 @@
//===- DWARFDataExtractor.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h b/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
index d277ec382ba5..28fd8484b4a9 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
@@ -1,9 +1,8 @@
//===- DWARFDebugAbbrev.h ---------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h b/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
index ffbd1b06d1e2..a98bf282fe7c 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
@@ -1,9 +1,8 @@
//===- DWARFDebugAddr.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h b/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
index ab46fac39f7c..5b6c578bc3bf 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
@@ -1,9 +1,8 @@
//===- DWARFDebugArangeSet.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h b/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
index ea71a50f3270..03223fbc80a9 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
@@ -1,9 +1,8 @@
//===- DWARFDebugAranges.h --------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -50,10 +49,6 @@ private:
return -1ULL;
}
- bool containsAddress(uint64_t Address) const {
- return LowPC <= Address && Address < HighPC();
- }
-
bool operator<(const Range &other) const {
return LowPC < other.LowPC;
}
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index 7dc07d774aba..d960f4bc9b1c 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -1,9 +1,8 @@
//===- DWARFDebugFrame.h - Parsing of .debug_frame --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h b/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
index 88c8f57bc33c..f50063b24370 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
@@ -1,9 +1,8 @@
//===- DWARFDebugInfoEntry.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
index d50af5a057f1..e7425c192373 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
@@ -1,9 +1,8 @@
//===- DWARFDebugLine.h -----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -122,6 +121,17 @@ public:
return LineBase + (int8_t)LineRange - 1;
}
+ /// Get DWARF-version aware access to the file name entry at the provided
+ /// index.
+ const llvm::DWARFDebugLine::FileNameEntry &
+ getFileNameEntry(uint64_t Index) const;
+
+ bool hasFileAtIndex(uint64_t FileIndex) const;
+
+ bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
+ DILineInfoSpecifier::FileLineInfoKind Kind,
+ std::string &Result) const;
+
void clear();
void dump(raw_ostream &OS, DIDumpOptions DumpOptions) const;
Error parse(const DWARFDataExtractor &DebugLineData, uint32_t *OffsetPtr,
@@ -140,12 +150,16 @@ public:
static void dumpTableHeader(raw_ostream &OS);
static bool orderByAddress(const Row &LHS, const Row &RHS) {
- return LHS.Address < RHS.Address;
+ return std::tie(LHS.Address.SectionIndex, LHS.Address.Address) <
+ std::tie(RHS.Address.SectionIndex, RHS.Address.Address);
}
/// The program-counter value corresponding to a machine instruction
- /// generated by the compiler.
- uint64_t Address;
+ /// generated by the compiler and section index pointing to the section
+ /// containg this PC. If relocation information is present then section
+ /// index is the index of the section which contains above address.
+ /// Otherwise this is object::SectionedAddress::Undef value.
+ object::SectionedAddress Address;
/// An unsigned integer indicating a source line number. Lines are numbered
/// beginning at 1. The compiler may emit the value 0 in cases where an
/// instruction cannot be attributed to any source line.
@@ -193,21 +207,29 @@ public:
/// and is described by line table rows [FirstRowIndex, LastRowIndex).
uint64_t LowPC;
uint64_t HighPC;
+ /// If relocation information is present then this is the index of the
+ /// section which contains above addresses. Otherwise this is
+ /// object::SectionedAddress::Undef value.
+ uint64_t SectionIndex;
unsigned FirstRowIndex;
unsigned LastRowIndex;
bool Empty;
void reset();
- static bool orderByLowPC(const Sequence &LHS, const Sequence &RHS) {
- return LHS.LowPC < RHS.LowPC;
+ static bool orderByHighPC(const Sequence &LHS, const Sequence &RHS) {
+ return std::tie(LHS.SectionIndex, LHS.HighPC) <
+ std::tie(RHS.SectionIndex, RHS.HighPC);
}
bool isValid() const {
return !Empty && (LowPC < HighPC) && (FirstRowIndex < LastRowIndex);
}
- bool containsPC(uint64_t PC) const { return (LowPC <= PC && PC < HighPC); }
+ bool containsPC(object::SectionedAddress PC) const {
+ return SectionIndex == PC.SectionIndex &&
+ (LowPC <= PC.Address && PC.Address < HighPC);
+ }
};
struct LineTable {
@@ -224,22 +246,30 @@ public:
/// Returns the index of the row with file/line info for a given address,
/// or UnknownRowIndex if there is no such row.
- uint32_t lookupAddress(uint64_t Address) const;
+ uint32_t lookupAddress(object::SectionedAddress Address) const;
- bool lookupAddressRange(uint64_t Address, uint64_t Size,
+ bool lookupAddressRange(object::SectionedAddress Address, uint64_t Size,
std::vector<uint32_t> &Result) const;
- bool hasFileAtIndex(uint64_t FileIndex) const;
+ bool hasFileAtIndex(uint64_t FileIndex) const {
+ return Prologue.hasFileAtIndex(FileIndex);
+ }
/// Extracts filename by its index in filename table in prologue.
+ /// In Dwarf 4, the files are 1-indexed and the current compilation file
+ /// name is not represented in the list. In DWARF v5, the files are
+ /// 0-indexed and the primary source file has the index 0.
/// Returns true on success.
- bool getFileNameByIndex(uint64_t FileIndex, const char *CompDir,
+ bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
DILineInfoSpecifier::FileLineInfoKind Kind,
- std::string &Result) const;
+ std::string &Result) const {
+ return Prologue.getFileNameByIndex(FileIndex, CompDir, Kind, Result);
+ }
/// Fills the Result argument with the file and line information
/// corresponding to Address. Returns true on success.
- bool getFileLineInfoForAddress(uint64_t Address, const char *CompDir,
+ bool getFileLineInfoForAddress(object::SectionedAddress Address,
+ const char *CompDir,
DILineInfoSpecifier::FileLineInfoKind Kind,
DILineInfo &Result) const;
@@ -264,10 +294,15 @@ public:
private:
uint32_t findRowInSeq(const DWARFDebugLine::Sequence &Seq,
- uint64_t Address) const;
+ object::SectionedAddress Address) const;
Optional<StringRef>
getSourceByIndex(uint64_t FileIndex,
DILineInfoSpecifier::FileLineInfoKind Kind) const;
+
+ uint32_t lookupAddressImpl(object::SectionedAddress Address) const;
+
+ bool lookupAddressRangeImpl(object::SectionedAddress Address, uint64_t Size,
+ std::vector<uint32_t> &Result) const;
};
const LineTable *getLineTable(uint32_t Offset) const;
@@ -334,13 +369,10 @@ private:
ParsingState(struct LineTable *LT);
void resetRowAndSequence();
- void appendRowToMatrix(uint32_t Offset);
+ void appendRowToMatrix();
/// Line table we're currently parsing.
struct LineTable *LineTable;
- /// The row number that starts at zero for the prologue, and increases for
- /// each row added to the matrix.
- unsigned RowNumber = 0;
struct Row Row;
struct Sequence Sequence;
};
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h b/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
index da2098e15402..cced6048e811 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
@@ -1,9 +1,8 @@
//===- DWARFDebugLoc.h ------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -42,7 +41,7 @@ public:
SmallVector<Entry, 2> Entries;
/// Dump this list on OS.
void dump(raw_ostream &OS, bool IsLittleEndian, unsigned AddressSize,
- const MCRegisterInfo *MRI, uint64_t BaseAddress,
+ const MCRegisterInfo *MRI, DWARFUnit *U, uint64_t BaseAddress,
unsigned Indent) const;
};
@@ -87,7 +86,7 @@ public:
SmallVector<Entry, 2> Entries;
void dump(raw_ostream &OS, uint64_t BaseAddr, bool IsLittleEndian,
unsigned AddressSize, const MCRegisterInfo *RegInfo,
- unsigned Indent) const;
+ DWARFUnit *U, unsigned Indent) const;
};
private:
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h b/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
index bfe2fc3ac02d..a6c125990ca7 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
@@ -1,9 +1,8 @@
//===- DWARFDebugMacro.h ----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h b/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
index 9e1656eb1615..99e91ca90319 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
@@ -1,9 +1,8 @@
//===- DWARFDebugPubTable.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h b/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
index bc26edf00647..a66f60292343 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
@@ -1,9 +1,8 @@
//===- DWARFDebugRangeList.h ------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -77,7 +76,7 @@ public:
/// list. Has to be passed base address of the compile unit referencing this
/// range list.
DWARFAddressRangesVector
- getAbsoluteRanges(llvm::Optional<SectionedAddress> BaseAddr) const;
+ getAbsoluteRanges(llvm::Optional<object::SectionedAddress> BaseAddr) const;
};
} // end namespace llvm
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h b/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
index 5cc8d789e598..167ddde3ec3d 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
@@ -1,9 +1,8 @@
//===- DWARFDebugRnglists.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -38,7 +37,7 @@ struct RangeListEntry : public DWARFListEntryBase {
Error extract(DWARFDataExtractor Data, uint32_t End, uint32_t *OffsetPtr);
void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
uint64_t &CurrentBase, DIDumpOptions DumpOpts,
- llvm::function_ref<Optional<SectionedAddress>(uint32_t)>
+ llvm::function_ref<Optional<object::SectionedAddress>(uint32_t)>
LookupPooledAddress) const;
bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
};
@@ -48,7 +47,7 @@ class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
public:
/// Build a DWARFAddressRangesVector from a rangelist.
DWARFAddressRangesVector
- getAbsoluteRanges(llvm::Optional<SectionedAddress> BaseAddr,
+ getAbsoluteRanges(llvm::Optional<object::SectionedAddress> BaseAddr,
DWARFUnit &U) const;
};
diff --git a/include/llvm/DebugInfo/DWARF/DWARFDie.h b/include/llvm/DebugInfo/DWARF/DWARFDie.h
index 56d46cd739a2..21e68f983bb3 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFDie.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFDie.h
@@ -1,9 +1,8 @@
//===- DWARFDie.h -----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFExpression.h b/include/llvm/DebugInfo/DWARF/DWARFExpression.h
index 3fad68a9b48b..f066dd58d606 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFExpression.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFExpression.h
@@ -1,9 +1,8 @@
//===--- DWARFExpression.h - DWARF Expression handling ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -42,7 +41,8 @@ public:
SizeAddr = 5,
SizeRefAddr = 6,
SizeBlock = 7, ///< Preceding operand contains block size
- SignBit = 0x8,
+ BaseTypeRef = 8,
+ SignBit = 0x80,
SignedSize1 = SignBit | Size1,
SignedSize2 = SignBit | Size2,
SignedSize4 = SignBit | Size4,
@@ -55,7 +55,8 @@ public:
DwarfNA, ///< Serves as a marker for unused entries
Dwarf2 = 2,
Dwarf3,
- Dwarf4
+ Dwarf4,
+ Dwarf5
};
/// Description of the encoding of one expression Op.
@@ -78,17 +79,20 @@ public:
bool Error;
uint32_t EndOffset;
uint64_t Operands[2];
+ uint32_t OperandEndOffsets[2];
public:
Description &getDescription() { return Desc; }
uint8_t getCode() { return Opcode; }
uint64_t getRawOperand(unsigned Idx) { return Operands[Idx]; }
+ uint32_t getOperandEndOffset(unsigned Idx) { return OperandEndOffsets[Idx]; }
uint32_t getEndOffset() { return EndOffset; }
bool extract(DataExtractor Data, uint16_t Version, uint8_t AddressSize,
uint32_t Offset);
bool isError() { return Error; }
- bool print(raw_ostream &OS, const DWARFExpression *U,
- const MCRegisterInfo *RegInfo, bool isEH);
+ bool print(raw_ostream &OS, const DWARFExpression *Expr,
+ const MCRegisterInfo *RegInfo, DWARFUnit *U, bool isEH);
+ bool verify(DWARFUnit *U);
};
/// An iterator to go through the expression operations.
@@ -125,15 +129,17 @@ public:
DWARFExpression(DataExtractor Data, uint16_t Version, uint8_t AddressSize)
: Data(Data), Version(Version), AddressSize(AddressSize) {
- assert(AddressSize == 8 || AddressSize == 4);
+ assert(AddressSize == 8 || AddressSize == 4 || AddressSize == 2);
}
iterator begin() const { return iterator(this, 0); }
iterator end() const { return iterator(this, Data.getData().size()); }
- void print(raw_ostream &OS, const MCRegisterInfo *RegInfo,
+ void print(raw_ostream &OS, const MCRegisterInfo *RegInfo, DWARFUnit *U,
bool IsEH = false) const;
+ bool verify(DWARFUnit *U);
+
private:
DataExtractor Data;
uint16_t Version;
diff --git a/include/llvm/DebugInfo/DWARF/DWARFFormValue.h b/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
index 727e853c09fb..731e71ed9eae 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
@@ -1,9 +1,8 @@
//===- DWARFFormValue.h -----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -42,6 +41,9 @@ public:
private:
struct ValueType {
ValueType() { uval = 0; }
+ ValueType(int64_t V) : sval(V) {}
+ ValueType(uint64_t V) : uval(V) {}
+ ValueType(const char *V) : cstr(V) {}
union {
uint64_t uval;
@@ -56,26 +58,28 @@ private:
ValueType Value; /// Contains all data for the form.
const DWARFUnit *U = nullptr; /// Remember the DWARFUnit at extract time.
const DWARFContext *C = nullptr; /// Context for extract time.
+
+ DWARFFormValue(dwarf::Form F, ValueType V) : Form(F), Value(V) {}
+
public:
DWARFFormValue(dwarf::Form F = dwarf::Form(0)) : Form(F) {}
+ static DWARFFormValue createFromSValue(dwarf::Form F, int64_t V);
+ static DWARFFormValue createFromUValue(dwarf::Form F, uint64_t V);
+ static DWARFFormValue createFromPValue(dwarf::Form F, const char *V);
+ static DWARFFormValue createFromBlockValue(dwarf::Form F,
+ ArrayRef<uint8_t> D);
+ static DWARFFormValue createFromUnit(dwarf::Form F, const DWARFUnit *Unit,
+ uint32_t *OffsetPtr);
+
dwarf::Form getForm() const { return Form; }
uint64_t getRawUValue() const { return Value.uval; }
- void setForm(dwarf::Form F) { Form = F; }
- void setUValue(uint64_t V) { Value.uval = V; }
- void setSValue(int64_t V) { Value.sval = V; }
- void setPValue(const char *V) { Value.cstr = V; }
-
- void setBlockValue(const ArrayRef<uint8_t> &Data) {
- Value.data = Data.data();
- setUValue(Data.size());
- }
bool isFormClass(FormClass FC) const;
const DWARFUnit *getUnit() const { return U; }
void dump(raw_ostream &OS, DIDumpOptions DumpOpts = DIDumpOptions()) const;
void dumpSectionedAddress(raw_ostream &OS, DIDumpOptions DumpOpts,
- SectionedAddress SA) const;
+ object::SectionedAddress SA) const;
static void dumpAddressSection(const DWARFObject &Obj, raw_ostream &OS,
DIDumpOptions DumpOpts, uint64_t SectionIndex);
@@ -100,11 +104,16 @@ public:
/// getAsFoo functions below return the extracted value as Foo if only
/// DWARFFormValue has form class is suitable for representing Foo.
Optional<uint64_t> getAsReference() const;
+ struct UnitOffset {
+ DWARFUnit *Unit;
+ uint64_t Offset;
+ };
+ Optional<UnitOffset> getAsRelativeReference() const;
Optional<uint64_t> getAsUnsignedConstant() const;
Optional<int64_t> getAsSignedConstant() const;
Optional<const char *> getAsCString() const;
Optional<uint64_t> getAsAddress() const;
- Optional<SectionedAddress> getAsSectionedAddress() const;
+ Optional<object::SectionedAddress> getAsSectionedAddress() const;
Optional<uint64_t> getAsSectionOffset() const;
Optional<ArrayRef<uint8_t>> getAsBlock() const;
Optional<uint64_t> getAsCStringOffset() const;
@@ -155,6 +164,19 @@ inline Optional<const char *> toString(const Optional<DWARFFormValue> &V) {
return None;
}
+/// Take an optional DWARFFormValue and try to extract a string value from it.
+///
+/// \param V and optional DWARFFormValue to attempt to extract the value from.
+/// \returns an optional value that contains a value if the form value
+/// was valid and was a string.
+inline StringRef toStringRef(const Optional<DWARFFormValue> &V,
+ StringRef Default = {}) {
+ if (V)
+ if (auto S = V->getAsCString())
+ return *S;
+ return Default;
+}
+
/// Take an optional DWARFFormValue and extract a string value from it.
///
/// \param V and optional DWARFFormValue to attempt to extract the value from.
@@ -242,7 +264,7 @@ inline Optional<uint64_t> toAddress(const Optional<DWARFFormValue> &V) {
return None;
}
-inline Optional<SectionedAddress>
+inline Optional<object::SectionedAddress>
toSectionedAddress(const Optional<DWARFFormValue> &V) {
if (V)
return V->getAsSectionedAddress();
diff --git a/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h b/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
index 073e02903c39..38cd42ddb883 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
@@ -1,9 +1,8 @@
//===- DWARFGdbIndex.h ------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFListTable.h b/include/llvm/DebugInfo/DWARF/DWARFListTable.h
index 9b987314f209..a1ea69b040f0 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFListTable.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFListTable.h
@@ -1,9 +1,8 @@
//===- DWARFListTable.h -----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -158,7 +157,7 @@ public:
uint8_t getAddrSize() const { return Header.getAddrSize(); }
void dump(raw_ostream &OS,
- llvm::function_ref<Optional<SectionedAddress>(uint32_t)>
+ llvm::function_ref<Optional<object::SectionedAddress>(uint32_t)>
LookupPooledAddress,
DIDumpOptions DumpOpts = {}) const;
@@ -235,7 +234,7 @@ Error DWARFListType<ListEntryType>::extract(DWARFDataExtractor Data,
template <typename DWARFListType>
void DWARFListTableBase<DWARFListType>::dump(
raw_ostream &OS,
- llvm::function_ref<Optional<SectionedAddress>(uint32_t)>
+ llvm::function_ref<Optional<object::SectionedAddress>(uint32_t)>
LookupPooledAddress,
DIDumpOptions DumpOpts) const {
Header.dump(OS, DumpOpts);
diff --git a/include/llvm/DebugInfo/DWARF/DWARFObject.h b/include/llvm/DebugInfo/DWARF/DWARFObject.h
index d611b5d075c8..1bba74a25d0e 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFObject.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFObject.h
@@ -1,9 +1,8 @@
//===- DWARFObject.h --------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===-----------------------------------------------------------------------===/
diff --git a/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h b/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
index f51838424614..3add711943d0 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
@@ -1,9 +1,8 @@
//===- DWARFRelocMap.h ------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -11,6 +10,7 @@
#define LLVM_DEBUGINFO_DWARF_DWARFRELOCMAP_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Object/RelocationResolver.h"
#include <cstdint>
namespace llvm {
@@ -19,7 +19,11 @@ namespace llvm {
/// Section index is -1LL if relocation points to absolute symbol.
struct RelocAddrEntry {
uint64_t SectionIndex;
- uint64_t Value;
+ object::RelocationRef Reloc;
+ uint64_t SymbolValue;
+ Optional<object::RelocationRef> Reloc2;
+ uint64_t SymbolValue2;
+ object::RelocationResolver Resolver;
};
/// In place of applying the relocations to the data we've read from disk we use
diff --git a/include/llvm/DebugInfo/DWARF/DWARFSection.h b/include/llvm/DebugInfo/DWARF/DWARFSection.h
index 7f8235965297..054524d368ed 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFSection.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFSection.h
@@ -1,9 +1,8 @@
//===- DWARFSection.h -------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -23,11 +22,6 @@ struct SectionName {
bool IsNameUnique;
};
-struct SectionedAddress {
- uint64_t Address;
- uint64_t SectionIndex;
-};
-
} // end namespace llvm
#endif // LLVM_DEBUGINFO_DWARF_DWARFSECTION_H
diff --git a/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h b/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
index 8ca5ba13fc23..90d89375fd35 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
@@ -1,9 +1,8 @@
//===- DWARFTypeUnit.h ------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/include/llvm/DebugInfo/DWARF/DWARFUnit.h
index 79c3ce1106d5..f9f90db31890 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFUnit.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFUnit.h
@@ -1,9 +1,8 @@
//===- DWARFUnit.h ----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -49,7 +48,7 @@ class DWARFUnitHeader {
uint32_t Offset = 0;
// Version, address size, and DWARF format.
dwarf::FormParams FormParams;
- uint32_t Length = 0;
+ uint64_t Length = 0;
uint64_t AbbrOffset = 0;
// For DWO units only.
@@ -83,7 +82,7 @@ public:
uint8_t getDwarfOffsetByteSize() const {
return FormParams.getDwarfOffsetByteSize();
}
- uint32_t getLength() const { return Length; }
+ uint64_t getLength() const { return Length; }
uint64_t getAbbrOffset() const { return AbbrOffset; }
Optional<uint64_t> getDWOId() const { return DWOId; }
void setDWOId(uint64_t Id) {
@@ -98,8 +97,11 @@ public:
return UnitType == dwarf::DW_UT_type || UnitType == dwarf::DW_UT_split_type;
}
uint8_t getSize() const { return Size; }
- // FIXME: Support DWARF64.
- uint32_t getNextUnitOffset() const { return Offset + Length + 4; }
+ uint32_t getNextUnitOffset() const {
+ return Offset + Length +
+ (FormParams.Format == llvm::dwarf::DwarfFormat::DWARF64 ? 4 : 0) +
+ FormParams.getDwarfOffsetByteSize();
+ }
};
const DWARFUnitIndex &getDWARFUnitIndex(DWARFContext &Context,
@@ -173,6 +175,7 @@ struct StrOffsetsContributionDescriptor {
StrOffsetsContributionDescriptor(uint64_t Base, uint64_t Size,
uint8_t Version, dwarf::DwarfFormat Format)
: Base(Base), Size(Size), FormParams({Version, 0, Format}) {}
+ StrOffsetsContributionDescriptor() = default;
uint8_t getVersion() const { return FormParams.Version; }
dwarf::DwarfFormat getFormat() const { return FormParams.Format; }
@@ -182,7 +185,7 @@ struct StrOffsetsContributionDescriptor {
/// Determine whether a contribution to the string offsets table is
/// consistent with the relevant section size and that its length is
/// a multiple of the size of one of its entries.
- Optional<StrOffsetsContributionDescriptor>
+ Expected<StrOffsetsContributionDescriptor>
validateContributionSize(DWARFDataExtractor &DA);
};
@@ -218,7 +221,7 @@ class DWARFUnit {
Optional<DWARFDebugRnglistTable> RngListTable;
mutable const DWARFAbbreviationDeclarationSet *Abbrevs;
- llvm::Optional<SectionedAddress> BaseAddr;
+ llvm::Optional<object::SectionedAddress> BaseAddr;
/// The compile unit debug information entry items.
std::vector<DWARFDebugInfoEntry> DieArray;
@@ -247,14 +250,14 @@ protected:
/// Find the unit's contribution to the string offsets table and determine its
/// length and form. The given offset is expected to be derived from the unit
/// DIE's DW_AT_str_offsets_base attribute.
- Optional<StrOffsetsContributionDescriptor>
+ Expected<Optional<StrOffsetsContributionDescriptor>>
determineStringOffsetsTableContribution(DWARFDataExtractor &DA);
/// Find the unit's contribution to the string offsets table and determine its
/// length and form. The given offset is expected to be 0 in a dwo file or,
/// in a dwp file, the start of the unit's contribution to the string offsets
/// table section (as determined by the index table).
- Optional<StrOffsetsContributionDescriptor>
+ Expected<Optional<StrOffsetsContributionDescriptor>>
determineStringOffsetsTableContributionDWO(DWARFDataExtractor &DA);
public:
@@ -305,7 +308,8 @@ public:
RangeSectionBase = Base;
}
- Optional<SectionedAddress> getAddrOffsetSectionItem(uint32_t Index) const;
+ Optional<object::SectionedAddress>
+ getAddrOffsetSectionItem(uint32_t Index) const;
Optional<uint64_t> getStringOffsetSectionItem(uint32_t Index) const;
DWARFDataExtractor getDebugInfoExtractor() const;
@@ -376,7 +380,7 @@ public:
llvm_unreachable("Invalid UnitType.");
}
- llvm::Optional<SectionedAddress> getBaseAddress();
+ llvm::Optional<object::SectionedAddress> getBaseAddress();
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly = true) {
extractDIEsIfNeeded(ExtractUnitDIEOnly);
@@ -385,6 +389,13 @@ public:
return DWARFDie(this, &DieArray[0]);
}
+ DWARFDie getNonSkeletonUnitDIE(bool ExtractUnitDIEOnly = true) {
+ parseDWO();
+ if (DWO)
+ return DWO->getUnitDIE(ExtractUnitDIEOnly);
+ return getUnitDIE(ExtractUnitDIEOnly);
+ }
+
const char *getCompilationDir();
Optional<uint64_t> getDWOId() {
extractDIEsIfNeeded(/*CUDieOnly*/ true);
@@ -462,13 +473,12 @@ public:
DWARFDie getDIEForOffset(uint32_t Offset) {
extractDIEsIfNeeded(false);
assert(!DieArray.empty());
- auto it = std::lower_bound(
- DieArray.begin(), DieArray.end(), Offset,
- [](const DWARFDebugInfoEntry &LHS, uint32_t Offset) {
- return LHS.getOffset() < Offset;
+ auto It =
+ llvm::partition_point(DieArray, [=](const DWARFDebugInfoEntry &DIE) {
+ return DIE.getOffset() < Offset;
});
- if (it != DieArray.end() && it->getOffset() == Offset)
- return DWARFDie(this, &*it);
+ if (It != DieArray.end() && It->getOffset() == Offset)
+ return DWARFDie(this, &*It);
return DWARFDie();
}
diff --git a/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h b/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
index 16be5f9401c0..fc8c707c512e 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
@@ -1,9 +1,8 @@
//===- DWARFUnitIndex.h -----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/DWARF/DWARFVerifier.h b/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
index e47fbea5646e..f1268f220272 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
@@ -1,9 +1,8 @@
//===- DWARFVerifier.h ----------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/GSYM/FileEntry.h b/include/llvm/DebugInfo/GSYM/FileEntry.h
new file mode 100644
index 000000000000..228b4efa0656
--- /dev/null
+++ b/include/llvm/DebugInfo/GSYM/FileEntry.h
@@ -0,0 +1,68 @@
+//===- FileEntry.h ----------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_GSYM_FILEENTRY_H
+#define LLVM_DEBUGINFO_GSYM_FILEENTRY_H
+
+#include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/ADT/Hashing.h"
+#include <functional>
+#include <stdint.h>
+#include <utility>
+
+namespace llvm {
+namespace gsym {
+
+/// Files in GSYM are contained in FileEntry structs where we split the
+/// directory and basename into two different strings in the string
+/// table. This allows paths to shared commont directory and filename
+/// strings and saves space.
+struct FileEntry {
+
+ /// Offsets in the string table.
+ /// @{
+ uint32_t Dir = 0;
+ uint32_t Base = 0;
+ /// @}
+
+ FileEntry() = default;
+ FileEntry(uint32_t D, uint32_t B) : Dir(D), Base(B) {}
+
+ // Implement operator== so that FileEntry can be used as key in
+ // unordered containers.
+ bool operator==(const FileEntry &RHS) const {
+ return Base == RHS.Base && Dir == RHS.Dir;
+ };
+ bool operator!=(const FileEntry &RHS) const {
+ return Base != RHS.Base || Dir != RHS.Dir;
+ };
+};
+
+} // namespace gsym
+
+template <> struct DenseMapInfo<gsym::FileEntry> {
+ static inline gsym::FileEntry getEmptyKey() {
+ uint32_t key = DenseMapInfo<uint32_t>::getEmptyKey();
+ return gsym::FileEntry(key, key);
+ }
+ static inline gsym::FileEntry getTombstoneKey() {
+ uint32_t key = DenseMapInfo<uint32_t>::getTombstoneKey();
+ return gsym::FileEntry(key, key);
+ }
+ static unsigned getHashValue(const gsym::FileEntry &Val) {
+ return llvm::hash_combine(DenseMapInfo<uint32_t>::getHashValue(Val.Dir),
+ DenseMapInfo<uint32_t>::getHashValue(Val.Base));
+ }
+ static bool isEqual(const gsym::FileEntry &LHS, const gsym::FileEntry &RHS) {
+ return LHS == RHS;
+ }
+};
+
+} // namespace llvm
+#endif // #ifndef LLVM_DEBUGINFO_GSYM_FILEENTRY_H
diff --git a/include/llvm/DebugInfo/GSYM/FunctionInfo.h b/include/llvm/DebugInfo/GSYM/FunctionInfo.h
new file mode 100644
index 000000000000..eedb1e638fd1
--- /dev/null
+++ b/include/llvm/DebugInfo/GSYM/FunctionInfo.h
@@ -0,0 +1,107 @@
+//===- FunctionInfo.h -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_GSYM_FUNCTIONINFO_H
+#define LLVM_DEBUGINFO_GSYM_FUNCTIONINFO_H
+
+#include "llvm/DebugInfo/GSYM/InlineInfo.h"
+#include "llvm/DebugInfo/GSYM/LineEntry.h"
+#include "llvm/DebugInfo/GSYM/Range.h"
+#include "llvm/DebugInfo/GSYM/StringTable.h"
+#include <tuple>
+#include <vector>
+
+namespace llvm {
+class raw_ostream;
+namespace gsym {
+
+/// Function information in GSYM files encodes information for one
+/// contiguous address range. The name of the function is encoded as
+/// a string table offset and allows multiple functions with the same
+/// name to share the name string in the string table. Line tables are
+/// stored in a sorted vector of gsym::LineEntry objects and are split
+/// into line tables for each function. If a function has a discontiguous
+/// range, it will be split into two gsym::FunctionInfo objects. If the
+/// function has inline functions, the information will be encoded in
+/// the "Inline" member, see gsym::InlineInfo for more information.
+struct FunctionInfo {
+ AddressRange Range;
+ uint32_t Name; ///< String table offset in the string table.
+ std::vector<gsym::LineEntry> Lines;
+ InlineInfo Inline;
+
+ FunctionInfo(uint64_t Addr = 0, uint64_t Size = 0, uint32_t N = 0)
+ : Range(Addr, Addr + Size), Name(N) {}
+
+ bool hasRichInfo() const {
+ /// Returns whether we have something else than range and name. When
+ /// converting information from a symbol table and from debug info, we
+ /// might end up with multiple FunctionInfo objects for the same range
+ /// and we need to be able to tell which one is the better object to use.
+ return !Lines.empty() || Inline.isValid();
+ }
+
+ bool isValid() const {
+ /// Address and size can be zero and there can be no line entries for a
+ /// symbol so the only indication this entry is valid is if the name is
+ /// not zero. This can happen when extracting information from symbol
+ /// tables that do not encode symbol sizes. In that case only the
+ /// address and name will be filled in.
+ return Name != 0;
+ }
+
+ uint64_t startAddress() const { return Range.Start; }
+ uint64_t endAddress() const { return Range.End; }
+ uint64_t size() const { return Range.size(); }
+ void setStartAddress(uint64_t Addr) { Range.Start = Addr; }
+ void setEndAddress(uint64_t Addr) { Range.End = Addr; }
+ void setSize(uint64_t Size) { Range.End = Range.Start + Size; }
+
+ void clear() {
+ Range = {0, 0};
+ Name = 0;
+ Lines.clear();
+ Inline.clear();
+ }
+};
+
+inline bool operator==(const FunctionInfo &LHS, const FunctionInfo &RHS) {
+ return LHS.Range == RHS.Range && LHS.Name == RHS.Name &&
+ LHS.Lines == RHS.Lines && LHS.Inline == RHS.Inline;
+}
+inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
+ return !(LHS == RHS);
+}
+/// This sorting will order things consistently by address range first, but then
+/// followed by inlining being valid and line tables. We might end up with a
+/// FunctionInfo from debug info that will have the same range as one from the
+/// symbol table, but we want to quickly be able to sort and use the best version
+/// when creating the final GSYM file.
+inline bool operator<(const FunctionInfo &LHS, const FunctionInfo &RHS) {
+ // First sort by address range
+ if (LHS.Range != RHS.Range)
+ return LHS.Range < RHS.Range;
+
+ // Then sort by inline
+ if (LHS.Inline.isValid() != RHS.Inline.isValid())
+ return RHS.Inline.isValid();
+
+ // If the number of lines is the same, then compare line table entries
+ if (LHS.Lines.size() == RHS.Lines.size())
+ return LHS.Lines < RHS.Lines;
+ // Then sort by number of line table entries (more is better)
+ return LHS.Lines.size() < RHS.Lines.size();
+}
+
+raw_ostream &operator<<(raw_ostream &OS, const FunctionInfo &R);
+
+} // namespace gsym
+} // namespace llvm
+
+#endif // #ifndef LLVM_DEBUGINFO_GSYM_FUNCTIONINFO_H
diff --git a/include/llvm/DebugInfo/GSYM/InlineInfo.h b/include/llvm/DebugInfo/GSYM/InlineInfo.h
new file mode 100644
index 000000000000..222430622932
--- /dev/null
+++ b/include/llvm/DebugInfo/GSYM/InlineInfo.h
@@ -0,0 +1,78 @@
+//===- InlineInfo.h ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_GSYM_INLINEINFO_H
+#define LLVM_DEBUGINFO_GSYM_INLINEINFO_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/DebugInfo/GSYM/Range.h"
+#include <stdint.h>
+#include <vector>
+
+
+namespace llvm {
+class raw_ostream;
+
+namespace gsym {
+
+/// Inline information stores the name of the inline function along with
+/// an array of address ranges. It also stores the call file and call line
+/// that called this inline function. This allows us to unwind inline call
+/// stacks back to the inline or concrete function that called this
+/// function. Inlined functions contained in this function are stored in the
+/// "Children" variable. All address ranges must be sorted and all address
+/// ranges of all children must be contained in the ranges of this function.
+/// Any clients that encode information will need to ensure the ranges are
+/// all contined correctly or lookups could fail. Add ranges in these objects
+/// must be contained in the top level FunctionInfo address ranges as well.
+struct InlineInfo {
+
+ uint32_t Name; ///< String table offset in the string table.
+ uint32_t CallFile; ///< 1 based file index in the file table.
+ uint32_t CallLine; ///< Source line number.
+ AddressRanges Ranges;
+ std::vector<InlineInfo> Children;
+ InlineInfo() : Name(0), CallFile(0), CallLine(0) {}
+ void clear() {
+ Name = 0;
+ CallFile = 0;
+ CallLine = 0;
+ Ranges.clear();
+ Children.clear();
+ }
+ bool isValid() const { return !Ranges.empty(); }
+
+ using InlineArray = std::vector<const InlineInfo *>;
+
+ /// Lookup an address in the InlineInfo object
+ ///
+ /// This function is used to symbolicate an inline call stack and can
+ /// turn one address in the program into one or more inline call stacks
+ /// and have the stack trace show the original call site from
+ /// non-inlined code.
+ ///
+ /// \param Addr the address to lookup
+ ///
+ /// \returns optional vector of InlineInfo objects that describe the
+ /// inline call stack for a given address, false otherwise.
+ llvm::Optional<InlineArray> getInlineStack(uint64_t Addr) const;
+};
+
+inline bool operator==(const InlineInfo &LHS, const InlineInfo &RHS) {
+ return LHS.Name == RHS.Name && LHS.CallFile == RHS.CallFile &&
+ LHS.CallLine == RHS.CallLine && LHS.Ranges == RHS.Ranges &&
+ LHS.Children == RHS.Children;
+}
+
+raw_ostream &operator<<(raw_ostream &OS, const InlineInfo &FI);
+
+} // namespace gsym
+} // namespace llvm
+
+#endif // #ifndef LLVM_DEBUGINFO_GSYM_INLINEINFO_H
diff --git a/include/llvm/DebugInfo/GSYM/LineEntry.h b/include/llvm/DebugInfo/GSYM/LineEntry.h
new file mode 100644
index 000000000000..6b9380940bd3
--- /dev/null
+++ b/include/llvm/DebugInfo/GSYM/LineEntry.h
@@ -0,0 +1,48 @@
+//===- LineEntry.h ----------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_GSYM_LINEENTRY_H
+#define LLVM_DEBUGINFO_GSYM_LINEENTRY_H
+
+#include "llvm/DebugInfo/GSYM/Range.h"
+
+namespace llvm {
+namespace gsym {
+
+/// Line entries are used to encode the line tables in FunctionInfo objects.
+/// They are stored as a sorted vector of these objects and store the
+/// address, file and line of the line table row for a given address. The
+/// size of a line table entry is calculated by looking at the next entry
+/// in the FunctionInfo's vector of entries.
+struct LineEntry {
+ uint64_t Addr; ///< Start address of this line entry.
+ uint32_t File; ///< 1 based index of file in FileTable
+ uint32_t Line; ///< Source line number.
+ LineEntry(uint64_t A = 0, uint32_t F = 0, uint32_t L = 0)
+ : Addr(A), File(F), Line(L) {}
+ bool isValid() { return File != 0; }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const LineEntry &LE) {
+ return OS << "addr=" << HEX64(LE.Addr) << ", file=" << format("%3u", LE.File)
+ << ", line=" << format("%3u", LE.Line);
+}
+
+inline bool operator==(const LineEntry &LHS, const LineEntry &RHS) {
+ return LHS.Addr == RHS.Addr && LHS.File == RHS.File && LHS.Line == RHS.Line;
+}
+inline bool operator!=(const LineEntry &LHS, const LineEntry &RHS) {
+ return !(LHS == RHS);
+}
+inline bool operator<(const LineEntry &LHS, const LineEntry &RHS) {
+ return LHS.Addr < RHS.Addr;
+}
+} // namespace gsym
+} // namespace llvm
+#endif // #ifndef LLVM_DEBUGINFO_GSYM_LINEENTRY_H
diff --git a/include/llvm/DebugInfo/GSYM/Range.h b/include/llvm/DebugInfo/GSYM/Range.h
new file mode 100644
index 000000000000..772ff244c5b7
--- /dev/null
+++ b/include/llvm/DebugInfo/GSYM/Range.h
@@ -0,0 +1,87 @@
+//===- AddressRange.h -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_GSYM_RANGE_H
+#define LLVM_DEBUGINFO_GSYM_RANGE_H
+
+#include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
+#include <stdint.h>
+#include <vector>
+
+#define HEX8(v) llvm::format_hex(v, 4)
+#define HEX16(v) llvm::format_hex(v, 6)
+#define HEX32(v) llvm::format_hex(v, 10)
+#define HEX64(v) llvm::format_hex(v, 18)
+
+namespace llvm {
+class raw_ostream;
+
+namespace gsym {
+
+/// A class that represents an address range. The range is specified using
+/// a start and an end address.
+struct AddressRange {
+ uint64_t Start;
+ uint64_t End;
+ AddressRange() : Start(0), End(0) {}
+ AddressRange(uint64_t S, uint64_t E) : Start(S), End(E) {}
+ uint64_t size() const { return End - Start; }
+ bool contains(uint64_t Addr) const { return Start <= Addr && Addr < End; }
+ bool intersects(const AddressRange &R) const {
+ return Start < R.End && R.Start < End;
+ }
+
+ bool operator==(const AddressRange &R) const {
+ return Start == R.Start && End == R.End;
+ }
+ bool operator!=(const AddressRange &R) const {
+ return !(*this == R);
+ }
+ bool operator<(const AddressRange &R) const {
+ return std::make_pair(Start, End) < std::make_pair(R.Start, R.End);
+ }
+};
+
+raw_ostream &operator<<(raw_ostream &OS, const AddressRange &R);
+
+/// The AddressRanges class helps normalize address range collections.
+/// This class keeps a sorted vector of AddressRange objects and can perform
+/// insertions and searches efficiently. The address ranges are always sorted
+/// and never contain any invalid or empty address ranges. This allows us to
+/// emit address ranges into the GSYM file efficiently. Intersecting address
+/// ranges are combined during insertion so that we can emit the most compact
+/// representation for address ranges when writing to disk.
+class AddressRanges {
+protected:
+ using Collection = std::vector<AddressRange>;
+ Collection Ranges;
+public:
+ void clear() { Ranges.clear(); }
+ bool empty() const { return Ranges.empty(); }
+ bool contains(uint64_t Addr) const;
+ void insert(AddressRange Range);
+ size_t size() const { return Ranges.size(); }
+ bool operator==(const AddressRanges &RHS) const {
+ return Ranges == RHS.Ranges;
+ }
+ const AddressRange &operator[](size_t i) const {
+ assert(i < Ranges.size());
+ return Ranges[i];
+ }
+ Collection::const_iterator begin() const { return Ranges.begin(); }
+ Collection::const_iterator end() const { return Ranges.end(); }
+};
+
+raw_ostream &operator<<(raw_ostream &OS, const AddressRanges &AR);
+
+} // namespace gsym
+} // namespace llvm
+
+#endif // #ifndef LLVM_DEBUGINFO_GSYM_RANGE_H
diff --git a/include/llvm/DebugInfo/GSYM/StringTable.h b/include/llvm/DebugInfo/GSYM/StringTable.h
new file mode 100644
index 000000000000..0001b8b82743
--- /dev/null
+++ b/include/llvm/DebugInfo/GSYM/StringTable.h
@@ -0,0 +1,54 @@
+//===- StringTable.h --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_GSYM_STRINGTABLE_H
+#define LLVM_DEBUGINFO_GSYM_STRINGTABLE_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/DebugInfo/GSYM/Range.h"
+#include <stdint.h>
+#include <string>
+
+
+namespace llvm {
+namespace gsym {
+
+/// String tables in GSYM files are required to start with an empty
+/// string at offset zero. Strings must be UTF8 NULL terminated strings.
+struct StringTable {
+ StringRef Data;
+ StringTable() : Data() {}
+ StringTable(StringRef D) : Data(D) {}
+ StringRef operator[](size_t Offset) const { return getString(Offset); }
+ StringRef getString(uint32_t Offset) const {
+ if (Offset < Data.size()) {
+ auto End = Data.find('\0', Offset);
+ return Data.substr(Offset, End - Offset);
+ }
+ return StringRef();
+ }
+ void clear() { Data = StringRef(); }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const StringTable &S) {
+ OS << "String table:\n";
+ uint32_t Offset = 0;
+ const size_t Size = S.Data.size();
+ while (Offset < Size) {
+ StringRef Str = S.getString(Offset);
+ OS << HEX32(Offset) << ": \"" << Str << "\"\n";
+ Offset += Str.size() + 1;
+ }
+ return OS;
+}
+
+} // namespace gsym
+} // namespace llvm
+#endif // #ifndef LLVM_DEBUGINFO_GSYM_STRINGTABLE_H
diff --git a/include/llvm/DebugInfo/MSF/IMSFFile.h b/include/llvm/DebugInfo/MSF/IMSFFile.h
index f98e715e6b15..7e80f96b89ae 100644
--- a/include/llvm/DebugInfo/MSF/IMSFFile.h
+++ b/include/llvm/DebugInfo/MSF/IMSFFile.h
@@ -1,9 +1,8 @@
//===- IMSFFile.h - Abstract base class for an MSF file ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/MSF/MSFBuilder.h b/include/llvm/DebugInfo/MSF/MSFBuilder.h
index 3de98c4ecba8..282870f5b3f1 100644
--- a/include/llvm/DebugInfo/MSF/MSFBuilder.h
+++ b/include/llvm/DebugInfo/MSF/MSFBuilder.h
@@ -1,9 +1,8 @@
//===- MSFBuilder.h - MSF Directory & Metadata Builder ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/MSF/MSFCommon.h b/include/llvm/DebugInfo/MSF/MSFCommon.h
index 2db2b71df4a7..83331b14b8af 100644
--- a/include/llvm/DebugInfo/MSF/MSFCommon.h
+++ b/include/llvm/DebugInfo/MSF/MSFCommon.h
@@ -1,9 +1,8 @@
//===- MSFCommon.h - Common types and functions for MSF files ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/MSF/MSFError.h b/include/llvm/DebugInfo/MSF/MSFError.h
index 5c043a7837b3..fbc4e6928536 100644
--- a/include/llvm/DebugInfo/MSF/MSFError.h
+++ b/include/llvm/DebugInfo/MSF/MSFError.h
@@ -1,9 +1,8 @@
//===- MSFError.h - Error extensions for MSF Files --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/MSF/MappedBlockStream.h b/include/llvm/DebugInfo/MSF/MappedBlockStream.h
index f65e52922da7..593d781b990e 100644
--- a/include/llvm/DebugInfo/MSF/MappedBlockStream.h
+++ b/include/llvm/DebugInfo/MSF/MappedBlockStream.h
@@ -1,9 +1,8 @@
//==- MappedBlockStream.h - Discontiguous stream data in an MSF --*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h b/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
index ac7f19637ab1..49ba20af7263 100644
--- a/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
+++ b/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
@@ -1,9 +1,8 @@
//===- ConcreteSymbolEnumerator.h -------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h b/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
index 881d7329ab66..f05b58c55507 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
@@ -1,9 +1,8 @@
//===- DIADataStream.h - DIA implementation of IPDBDataStream ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
index 1f129052d034..8a00ad45291a 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
@@ -1,9 +1,8 @@
//==- DIAEnumDebugStreams.h - DIA Debug Stream Enumerator impl ---*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h
index f3b02f07e648..bd417c0746b1 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h
@@ -1,9 +1,8 @@
//==- DIAEnumFrameData.h --------------------------------------- -*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
index 4669a8d31196..1f75ca27c4f8 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
@@ -1,9 +1,8 @@
//==- DIAEnumInjectedSources.h - DIA Injected Sources Enumerator -*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
index f1cb6268a26d..8800baac105d 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
@@ -1,9 +1,8 @@
//==- DIAEnumLineNumbers.h - DIA Line Number Enumerator impl -----*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
index ac2ae317d263..be8613bfba9d 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
@@ -1,9 +1,8 @@
//==- DIAEnumSectionContribs.h --------------------------------- -*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h
index dac3df06a178..61278994ed36 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h
@@ -1,9 +1,8 @@
//==- DIAEnumSourceFiles.h - DIA Source File Enumerator impl -----*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
index 9689859ae0f8..f55342cea2e5 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
@@ -1,9 +1,8 @@
//==- DIAEnumSymbols.h - DIA Symbol Enumerator impl --------------*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h b/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
index f4f856ebb6fd..057cb06fc8ca 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
@@ -1,9 +1,8 @@
//===- DIAEnumTables.h - DIA Tables Enumerator Impl -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAError.h b/include/llvm/DebugInfo/PDB/DIA/DIAError.h
index 2b33a65a0a14..96d960599f7e 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAError.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAError.h
@@ -1,9 +1,8 @@
//===- DIAError.h - Error extensions for PDB DIA implementation -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h b/include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h
index 0ce6cfc93030..c04f7cd00836 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h
@@ -1,9 +1,8 @@
//===- DIAFrameData.h - DIA Impl. of IPDBFrameData ---------------- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h b/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h
index 635508da84ea..67963a06d939 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h
@@ -1,9 +1,8 @@
//===- DIAInjectedSource.h - DIA impl for IPDBInjectedSource ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -26,7 +25,7 @@ public:
std::string getFileName() const override;
std::string getObjectFileName() const override;
std::string getVirtualFileName() const override;
- PDB_SourceCompression getCompression() const override;
+ uint32_t getCompression() const override;
std::string getCode() const override;
private:
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h b/include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h
index a59e3a19c8c2..d8bb27220763 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h
@@ -1,9 +1,8 @@
//===- DIALineNumber.h - DIA implementation of IPDBLineNumber ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h b/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
index 5d4f855c63ca..7f201d3a4e36 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
@@ -1,9 +1,8 @@
//===- DIARawSymbol.h - DIA implementation of IPDBRawSymbol ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h b/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h
index 4688f1f91a89..0972831e8b16 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h
@@ -1,9 +1,8 @@
//===- DIASectionContrib.h - DIA Impl. of IPDBSectionContrib ------ C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIASession.h b/include/llvm/DebugInfo/PDB/DIA/DIASession.h
index 592e061a8d83..6f62e6061f56 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIASession.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIASession.h
@@ -1,9 +1,8 @@
//===- DIASession.h - DIA implementation of IPDBSession ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIASourceFile.h b/include/llvm/DebugInfo/PDB/DIA/DIASourceFile.h
index 1088ea54981c..96edfc9f9e29 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIASourceFile.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIASourceFile.h
@@ -1,9 +1,8 @@
//===- DIASourceFile.h - DIA implementation of IPDBSourceFile ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIASupport.h b/include/llvm/DebugInfo/PDB/DIA/DIASupport.h
index 92ebc04ae5a4..1a7c2f3aeeab 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIASupport.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIASupport.h
@@ -1,9 +1,8 @@
//===- DIASupport.h - Common header includes for DIA ------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// Common defines and header includes for all LLVMDebugInfoPDBDIA. The
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIATable.h b/include/llvm/DebugInfo/PDB/DIA/DIATable.h
index ce93fa0b86c3..65396a042f06 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIATable.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIATable.h
@@ -1,9 +1,8 @@
//===- DIATable.h - DIA implementation of IPDBTable -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h b/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h
index aa843e05de70..5e01d8f10a6e 100644
--- a/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h
+++ b/include/llvm/DebugInfo/PDB/DIA/DIAUtils.h
@@ -1,9 +1,8 @@
//===- DIAUtils.h - Utility functions for working with DIA ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/GenericError.h b/include/llvm/DebugInfo/PDB/GenericError.h
index 997f13f5f30e..ec85d92d2a92 100644
--- a/include/llvm/DebugInfo/PDB/GenericError.h
+++ b/include/llvm/DebugInfo/PDB/GenericError.h
@@ -1,9 +1,8 @@
-//===- Error.h - system_error extensions for PDB ----------------*- C++ -*-===//
+//===- GenericError.h - system_error extensions for PDB ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBDataStream.h b/include/llvm/DebugInfo/PDB/IPDBDataStream.h
index 0d7a286a11a6..4d0589a87915 100644
--- a/include/llvm/DebugInfo/PDB/IPDBDataStream.h
+++ b/include/llvm/DebugInfo/PDB/IPDBDataStream.h
@@ -1,9 +1,8 @@
//===- IPDBDataStream.h - base interface for child enumerator ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
index 7017f2600e9b..bfa67d39bc76 100644
--- a/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+++ b/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
@@ -1,9 +1,8 @@
//===- IPDBEnumChildren.h - base interface for child enumerator -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBFrameData.h b/include/llvm/DebugInfo/PDB/IPDBFrameData.h
index 74679215b880..24138b380db4 100644
--- a/include/llvm/DebugInfo/PDB/IPDBFrameData.h
+++ b/include/llvm/DebugInfo/PDB/IPDBFrameData.h
@@ -1,9 +1,8 @@
//===- IPDBFrameData.h - base interface for frame data ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h b/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
index e75d64af92bb..d5b36f9846b5 100644
--- a/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
+++ b/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
@@ -1,16 +1,14 @@
//===- IPDBInjectedSource.h - base class for PDB injected file --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
#define LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
-#include "PDBTypes.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
#include <string>
@@ -33,7 +31,10 @@ public:
virtual std::string getFileName() const = 0;
virtual std::string getObjectFileName() const = 0;
virtual std::string getVirtualFileName() const = 0;
- virtual PDB_SourceCompression getCompression() const = 0;
+ // The returned value depends on the PDB producer,
+ // but 0 is guaranteed to mean "no compression".
+ // The enum PDB_SourceCompression lists known return values.
+ virtual uint32_t getCompression() const = 0;
virtual std::string getCode() const = 0;
};
} // namespace pdb
diff --git a/include/llvm/DebugInfo/PDB/IPDBLineNumber.h b/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
index e20080f2fbfc..77e88999497e 100644
--- a/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
+++ b/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
@@ -1,9 +1,8 @@
//===- IPDBLineNumber.h - base interface for PDB line no. info ---*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h b/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
index 7c818d7cadeb..b24e712e3b78 100644
--- a/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
+++ b/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -1,9 +1,8 @@
//===- IPDBRawSymbol.h - base interface for PDB symbol types ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h b/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
index 4fda62404672..c5cf4bbe5560 100644
--- a/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
+++ b/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
@@ -1,9 +1,8 @@
//==- IPDBSectionContrib.h - Interfaces for PDB SectionContribs --*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBSession.h b/include/llvm/DebugInfo/PDB/IPDBSession.h
index 88fd02c0a345..aa8d9c76d63e 100644
--- a/include/llvm/DebugInfo/PDB/IPDBSession.h
+++ b/include/llvm/DebugInfo/PDB/IPDBSession.h
@@ -1,9 +1,8 @@
//===- IPDBSession.h - base interface for a PDB symbol context --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBSourceFile.h b/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
index 3676c4030b13..d7e49fb70580 100644
--- a/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
+++ b/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
@@ -1,9 +1,8 @@
//===- IPDBSourceFile.h - base interface for a PDB source file --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/IPDBTable.h b/include/llvm/DebugInfo/PDB/IPDBTable.h
index 4561c4e847b2..55ca230d58c4 100644
--- a/include/llvm/DebugInfo/PDB/IPDBTable.h
+++ b/include/llvm/DebugInfo/PDB/IPDBTable.h
@@ -1,9 +1,8 @@
//===- IPDBTable.h - Base Interface for a PDB Symbol Context ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
index 9eef4041d0a1..568f0c98c559 100644
--- a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
+++ b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
@@ -1,9 +1,8 @@
//===- DbiModuleDescriptor.h - PDB module information -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
index ac7f741afefa..4f5d28bbd05a 100644
--- a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
@@ -1,9 +1,8 @@
//===- DbiModuleDescriptorBuilder.h - PDB module information ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h b/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
index 5f6e7ab92a96..14223273c898 100644
--- a/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
+++ b/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
@@ -1,9 +1,8 @@
//===- DbiModuleList.h - PDB module information list ------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiStream.h b/include/llvm/DebugInfo/PDB/Native/DbiStream.h
index a3ca607efbef..7d75c159b7ae 100644
--- a/include/llvm/DebugInfo/PDB/Native/DbiStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/DbiStream.h
@@ -1,9 +1,8 @@
//===- DbiStream.h - PDB Dbi Stream (Stream 3) Access -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -11,6 +10,7 @@
#define LLVM_DEBUGINFO_PDB_RAW_PDBDBISTREAM_H
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h"
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
#include "llvm/DebugInfo/PDB/Native/DbiModuleList.h"
@@ -80,7 +80,10 @@ public:
FixedStreamArray<object::coff_section> getSectionHeaders() const;
- FixedStreamArray<object::FpoData> getFpoRecords();
+ bool hasOldFpoRecords() const;
+ FixedStreamArray<object::FpoData> getOldFpoRecords() const;
+ bool hasNewFpoRecords() const;
+ const codeview::DebugFrameDataSubsectionRef &getNewFpoRecords() const;
FixedStreamArray<SecMapEntry> getSectionMap() const;
void visitSectionContributions(ISectionContribVisitor &Visitor) const;
@@ -91,7 +94,11 @@ private:
Error initializeSectionContributionData();
Error initializeSectionHeadersData(PDBFile *Pdb);
Error initializeSectionMapData();
- Error initializeFpoRecords(PDBFile *Pdb);
+ Error initializeOldFpoRecords(PDBFile *Pdb);
+ Error initializeNewFpoRecords(PDBFile *Pdb);
+
+ Expected<std::unique_ptr<msf::MappedBlockStream>>
+ createIndexedStreamForHeaderType(PDBFile *Pdb, DbgHeaderType Type) const;
std::unique_ptr<BinaryStream> Stream;
@@ -117,8 +124,11 @@ private:
std::unique_ptr<msf::MappedBlockStream> SectionHeaderStream;
FixedStreamArray<object::coff_section> SectionHeaders;
- std::unique_ptr<msf::MappedBlockStream> FpoStream;
- FixedStreamArray<object::FpoData> FpoRecords;
+ std::unique_ptr<msf::MappedBlockStream> OldFpoStream;
+ FixedStreamArray<object::FpoData> OldFpoRecords;
+
+ std::unique_ptr<msf::MappedBlockStream> NewFpoStream;
+ codeview::DebugFrameDataSubsectionRef NewFpoRecords;
const DbiStreamHeader *Header;
};
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h b/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
index b538de576677..d9be238af07b 100644
--- a/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
@@ -1,9 +1,8 @@
//===- DbiStreamBuilder.h - PDB Dbi Stream Creation -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/EnumTables.h b/include/llvm/DebugInfo/PDB/Native/EnumTables.h
index c018445630fe..70161fadf7d2 100644
--- a/include/llvm/DebugInfo/PDB/Native/EnumTables.h
+++ b/include/llvm/DebugInfo/PDB/Native/EnumTables.h
@@ -1,9 +1,8 @@
//===- EnumTables.h - Enum to string conversion tables ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/Formatters.h b/include/llvm/DebugInfo/PDB/Native/Formatters.h
index 7d5eab2e2a09..29c957eeb5e0 100644
--- a/include/llvm/DebugInfo/PDB/Native/Formatters.h
+++ b/include/llvm/DebugInfo/PDB/Native/Formatters.h
@@ -1,9 +1,8 @@
//===- Formatters.h ---------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h b/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
index 4c39ca762b5b..a49795600028 100644
--- a/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
@@ -1,9 +1,8 @@
//===- GSIStreamBuilder.h - PDB Publics/Globals Stream Creation -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h b/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
index 7f84564ee988..404baaa25077 100644
--- a/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
@@ -1,9 +1,8 @@
//===- GlobalsStream.h - PDB Index of Symbols by Name -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/Hash.h b/include/llvm/DebugInfo/PDB/Native/Hash.h
index 1f11d43ecdd4..b048d878a12c 100644
--- a/include/llvm/DebugInfo/PDB/Native/Hash.h
+++ b/include/llvm/DebugInfo/PDB/Native/Hash.h
@@ -1,9 +1,8 @@
//===- Hash.h - PDB hash functions ------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/HashTable.h b/include/llvm/DebugInfo/PDB/Native/HashTable.h
index 34cc6179688b..aa38417bcf4c 100644
--- a/include/llvm/DebugInfo/PDB/Native/HashTable.h
+++ b/include/llvm/DebugInfo/PDB/Native/HashTable.h
@@ -1,9 +1,8 @@
//===- HashTable.h - PDB Hash Table -----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -32,21 +31,21 @@ namespace pdb {
Error readSparseBitVector(BinaryStreamReader &Stream, SparseBitVector<> &V);
Error writeSparseBitVector(BinaryStreamWriter &Writer, SparseBitVector<> &Vec);
-template <typename ValueT, typename TraitsT> class HashTable;
+template <typename ValueT> class HashTable;
-template <typename ValueT, typename TraitsT>
+template <typename ValueT>
class HashTableIterator
- : public iterator_facade_base<HashTableIterator<ValueT, TraitsT>,
+ : public iterator_facade_base<HashTableIterator<ValueT>,
std::forward_iterator_tag,
- std::pair<uint32_t, ValueT>> {
- friend HashTable<ValueT, TraitsT>;
+ const std::pair<uint32_t, ValueT>> {
+ friend HashTable<ValueT>;
- HashTableIterator(const HashTable<ValueT, TraitsT> &Map, uint32_t Index,
+ HashTableIterator(const HashTable<ValueT> &Map, uint32_t Index,
bool IsEnd)
: Map(&Map), Index(Index), IsEnd(IsEnd) {}
public:
- HashTableIterator(const HashTable<ValueT, TraitsT> &Map) : Map(&Map) {
+ HashTableIterator(const HashTable<ValueT> &Map) : Map(&Map) {
int I = Map.Present.find_first();
if (I == -1) {
Index = 0;
@@ -73,6 +72,12 @@ public:
assert(Map->Present.test(Index));
return Map->Buckets[Index];
}
+
+ // Implement postfix op++ in terms of prefix op++ by using the superclass
+ // implementation.
+ using iterator_facade_base<HashTableIterator<ValueT>,
+ std::forward_iterator_tag,
+ const std::pair<uint32_t, ValueT>>::operator++;
HashTableIterator &operator++() {
while (Index < Map->Buckets.size()) {
++Index;
@@ -88,24 +93,13 @@ private:
bool isEnd() const { return IsEnd; }
uint32_t index() const { return Index; }
- const HashTable<ValueT, TraitsT> *Map;
+ const HashTable<ValueT> *Map;
uint32_t Index;
bool IsEnd;
};
-template <typename T> struct PdbHashTraits {};
-
-template <> struct PdbHashTraits<uint32_t> {
- uint32_t hashLookupKey(uint32_t N) const { return N; }
- uint32_t storageKeyToLookupKey(uint32_t N) const { return N; }
- uint32_t lookupKeyToStorageKey(uint32_t N) { return N; }
-};
-
-template <typename ValueT, typename TraitsT = PdbHashTraits<ValueT>>
+template <typename ValueT>
class HashTable {
- using iterator = HashTableIterator<ValueT, TraitsT>;
- friend iterator;
-
struct Header {
support::ulittle32_t Size;
support::ulittle32_t Capacity;
@@ -114,10 +108,11 @@ class HashTable {
using BucketList = std::vector<std::pair<uint32_t, ValueT>>;
public:
- HashTable() { Buckets.resize(8); }
+ using const_iterator = HashTableIterator<ValueT>;
+ friend const_iterator;
- explicit HashTable(TraitsT Traits) : HashTable(8, std::move(Traits)) {}
- HashTable(uint32_t Capacity, TraitsT Traits) : Traits(Traits) {
+ HashTable() { Buckets.resize(8); }
+ explicit HashTable(uint32_t Capacity) {
Buckets.resize(Capacity);
}
@@ -144,7 +139,7 @@ public:
return EC;
if (Present.intersects(Deleted))
return make_error<RawError>(raw_error_code::corrupt_file,
- "Present bit vector interesects deleted!");
+ "Present bit vector intersects deleted!");
for (uint32_t P : Present) {
if (auto EC = Stream.readInteger(Buckets[P].first))
@@ -217,19 +212,20 @@ public:
uint32_t capacity() const { return Buckets.size(); }
uint32_t size() const { return Present.count(); }
- iterator begin() const { return iterator(*this); }
- iterator end() const { return iterator(*this, 0, true); }
+ const_iterator begin() const { return const_iterator(*this); }
+ const_iterator end() const { return const_iterator(*this, 0, true); }
/// Find the entry whose key has the specified hash value, using the specified
/// traits defining hash function and equality.
- template <typename Key> iterator find_as(const Key &K) const {
+ template <typename Key, typename TraitsT>
+ const_iterator find_as(const Key &K, TraitsT &Traits) const {
uint32_t H = Traits.hashLookupKey(K) % capacity();
uint32_t I = H;
Optional<uint32_t> FirstUnused;
do {
if (isPresent(I)) {
if (Traits.storageKeyToLookupKey(Buckets[I].first) == K)
- return iterator(*this, I, false);
+ return const_iterator(*this, I, false);
} else {
if (!FirstUnused)
FirstUnused = I;
@@ -248,17 +244,19 @@ public:
// table were Present. But this would violate the load factor constraints
// that we impose, so it should never happen.
assert(FirstUnused);
- return iterator(*this, *FirstUnused, true);
+ return const_iterator(*this, *FirstUnused, true);
}
/// Set the entry using a key type that the specified Traits can convert
/// from a real key to an internal key.
- template <typename Key> bool set_as(const Key &K, ValueT V) {
- return set_as_internal(K, std::move(V), None);
+ template <typename Key, typename TraitsT>
+ bool set_as(const Key &K, ValueT V, TraitsT &Traits) {
+ return set_as_internal(K, std::move(V), Traits, None);
}
- template <typename Key> ValueT get(const Key &K) const {
- auto Iter = find_as(K);
+ template <typename Key, typename TraitsT>
+ ValueT get(const Key &K, TraitsT &Traits) const {
+ auto Iter = find_as(K, Traits);
assert(Iter != end());
return (*Iter).second;
}
@@ -267,7 +265,6 @@ protected:
bool isPresent(uint32_t K) const { return Present.test(K); }
bool isDeleted(uint32_t K) const { return Deleted.test(K); }
- TraitsT Traits;
BucketList Buckets;
mutable SparseBitVector<> Present;
mutable SparseBitVector<> Deleted;
@@ -275,9 +272,10 @@ protected:
private:
/// Set the entry using a key type that the specified Traits can convert
/// from a real key to an internal key.
- template <typename Key>
- bool set_as_internal(const Key &K, ValueT V, Optional<uint32_t> InternalKey) {
- auto Entry = find_as(K);
+ template <typename Key, typename TraitsT>
+ bool set_as_internal(const Key &K, ValueT V, TraitsT &Traits,
+ Optional<uint32_t> InternalKey) {
+ auto Entry = find_as(K, Traits);
if (Entry != end()) {
assert(isPresent(Entry.index()));
assert(Traits.storageKeyToLookupKey(Buckets[Entry.index()].first) == K);
@@ -294,15 +292,16 @@ private:
Present.set(Entry.index());
Deleted.reset(Entry.index());
- grow();
+ grow(Traits);
- assert((find_as(K)) != end());
+ assert((find_as(K, Traits)) != end());
return true;
}
static uint32_t maxLoad(uint32_t capacity) { return capacity * 2 / 3 + 1; }
- void grow() {
+ template <typename TraitsT>
+ void grow(TraitsT &Traits) {
uint32_t S = size();
uint32_t MaxLoad = maxLoad(capacity());
if (S < maxLoad(capacity()))
@@ -314,10 +313,11 @@ private:
// Growing requires rebuilding the table and re-hashing every item. Make a
// copy with a larger capacity, insert everything into the copy, then swap
// it in.
- HashTable NewMap(NewCapacity, Traits);
+ HashTable NewMap(NewCapacity);
for (auto I : Present) {
auto LookupKey = Traits.storageKeyToLookupKey(Buckets[I].first);
- NewMap.set_as_internal(LookupKey, Buckets[I].second, Buckets[I].first);
+ NewMap.set_as_internal(LookupKey, Buckets[I].second, Traits,
+ Buckets[I].first);
}
Buckets.swap(NewMap.Buckets);
diff --git a/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h b/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
index fb00d6ad4bc7..717dce2f2737 100644
--- a/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
+++ b/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
@@ -1,9 +1,8 @@
//===- ISectionContribVisitor.h ---------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/InfoStream.h b/include/llvm/DebugInfo/PDB/Native/InfoStream.h
index 8c52b042f289..315b09356ae3 100644
--- a/include/llvm/DebugInfo/PDB/Native/InfoStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/InfoStream.h
@@ -1,9 +1,8 @@
//===- InfoStream.h - PDB Info Stream (Stream 1) Access ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h b/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
index 101127a355f5..208a37c45d49 100644
--- a/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
@@ -1,9 +1,8 @@
//===- InfoStreamBuilder.h - PDB Info Stream Creation -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h b/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
new file mode 100644
index 000000000000..d0cac3749bca
--- /dev/null
+++ b/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
@@ -0,0 +1,44 @@
+//===- InjectedSourceStream.h - PDB Headerblock Stream Access ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_RAW_PDBINJECTEDSOURCESTREAM_H
+#define LLVM_DEBUGINFO_PDB_RAW_PDBINJECTEDSOURCESTREAM_H
+
+#include "llvm/DebugInfo/PDB/Native/HashTable.h"
+#include "llvm/DebugInfo/PDB/Native/RawTypes.h"
+#include "llvm/Support/Error.h"
+
+namespace llvm {
+namespace msf {
+class MappedBlockStream;
+}
+namespace pdb {
+class PDBFile;
+class PDBStringTable;
+
+class InjectedSourceStream {
+public:
+ InjectedSourceStream(std::unique_ptr<msf::MappedBlockStream> Stream);
+ Error reload(const PDBStringTable &Strings);
+
+ using const_iterator = HashTable<SrcHeaderBlockEntry>::const_iterator;
+ const_iterator begin() const { return InjectedSourceTable.begin(); }
+ const_iterator end() const { return InjectedSourceTable.end(); }
+
+ uint32_t size() const { return InjectedSourceTable.size(); }
+
+private:
+ std::unique_ptr<msf::MappedBlockStream> Stream;
+
+ const SrcHeaderBlockHeader* Header;
+ HashTable<SrcHeaderBlockEntry> InjectedSourceTable;
+};
+}
+}
+
+#endif
diff --git a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
index 8d590df288f3..cb1ffc729512 100644
--- a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
@@ -1,9 +1,8 @@
//===- ModuleDebugStream.h - PDB Module Info Stream Access ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -69,6 +68,8 @@ public:
findChecksumsSubsection() const;
private:
+ Error reloadSerialize(BinaryStreamReader &Reader);
+
DbiModuleDescriptor Mod;
uint32_t Signature;
diff --git a/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h b/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
index 01b8f1b5da56..1df059ffa9fd 100644
--- a/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
+++ b/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
@@ -1,9 +1,8 @@
//===- NamedStreamMap.h - PDB Named Stream Map ------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -60,7 +59,7 @@ private:
NamedStreamMapTraits HashTraits;
/// Closed hash table from Offset -> StreamNumber, where Offset is the offset
/// of the stream name in NamesBuffer.
- HashTable<support::ulittle32_t, NamedStreamMapTraits> OffsetIndexMap;
+ HashTable<support::ulittle32_t> OffsetIndexMap;
/// Buffer of string data.
std::vector<char> NamesBuffer;
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
index 3cd465503044..50d437642d0f 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
@@ -1,9 +1,8 @@
//===- NativeCompilandSymbol.h - native impl for compiland syms -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h b/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
index 4442a1ec41fb..073878afd129 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
@@ -1,9 +1,8 @@
//==- NativeEnumGlobals.h - Native Global Enumerator impl --------*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h b/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
new file mode 100644
index 000000000000..ca1e22bd82a2
--- /dev/null
+++ b/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
@@ -0,0 +1,43 @@
+//==- NativeEnumInjectedSources.cpp - Native Injected Source Enumerator --*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMINJECTEDSOURCES_H
+#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMINJECTEDSOURCES_H
+
+#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"
+#include "llvm/DebugInfo/PDB/Native/InjectedSourceStream.h"
+
+namespace llvm {
+namespace pdb {
+
+class InjectedSourceStream;
+class PDBStringTable;
+
+class NativeEnumInjectedSources : public IPDBEnumChildren<IPDBInjectedSource> {
+public:
+ NativeEnumInjectedSources(PDBFile &File, const InjectedSourceStream &IJS,
+ const PDBStringTable &Strings);
+
+ uint32_t getChildCount() const override;
+ std::unique_ptr<IPDBInjectedSource>
+ getChildAtIndex(uint32_t Index) const override;
+ std::unique_ptr<IPDBInjectedSource> getNext() override;
+ void reset() override;
+
+private:
+ PDBFile &File;
+ const InjectedSourceStream &Stream;
+ const PDBStringTable &Strings;
+ InjectedSourceStream::const_iterator Cur;
+};
+
+} // namespace pdb
+} // namespace llvm
+
+#endif
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h b/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
index c268641a1008..94f1ee18ed9f 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
@@ -1,9 +1,8 @@
//==- NativeEnumModules.h - Native Module Enumerator impl --------*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h b/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
index f8ac1655dc61..25c56567384f 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
@@ -1,9 +1,8 @@
//==- NativeEnumTypes.h - Native Type Enumerator impl ------------*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
index f4030da1d026..280358d02305 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
@@ -1,9 +1,8 @@
//===- NativeExeSymbol.h - native impl for PDBSymbolExe ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
index 6505a7d39573..4133be220713 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
@@ -1,9 +1,8 @@
//==- NativeRawSymbol.h - Native implementation of IPDBRawSymbol -*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/include/llvm/DebugInfo/PDB/Native/NativeSession.h
index 4878e47d3121..ee7d8cdec93b 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeSession.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeSession.h
@@ -1,9 +1,8 @@
//===- NativeSession.h - Native implementation of IPDBSession ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h b/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
index acc5eb8ff2c2..063585097899 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
@@ -1,9 +1,8 @@
//===- NativeSymbolEnumerator.h - info about enumerator values --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
index 10e68e6df450..262864fd709f 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
@@ -1,9 +1,8 @@
//===- NativeTypeArray.h ------------------------------------------ C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
index 725dfb89222f..8bb09f05d0bc 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
@@ -1,9 +1,8 @@
//===- NativeTypeBuiltin.h ---------------------------------------- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
index a5cbefc18111..2068c88fc74a 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
@@ -1,9 +1,8 @@
//===- NativeTypeEnum.h - info about enum type ------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
index 1b1b87f6581f..a7ea287dffc8 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
@@ -1,9 +1,8 @@
//===- NativeTypeFunctionSig.h - info about function signature ---*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h b/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
index bcb7431fecf1..446f77db0f6c 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
@@ -1,9 +1,8 @@
//===- NativeTypePointer.h - info about pointer type -------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
index 06eb6fcf3764..fe8a6f7f2bda 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
@@ -1,9 +1,8 @@
//===- NativeTypeTypedef.h - info about typedef ------------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
index 84821d8731be..8f4dee3e658c 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
@@ -1,9 +1,8 @@
//===- NativeTypeUDT.h - info about class/struct type ------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h b/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
index a996f34ef859..4ec0f9bf6b3d 100644
--- a/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
+++ b/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
@@ -1,9 +1,8 @@
//===- NativeTypeVTShape.h - info about virtual table shape ------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/PDBFile.h b/include/llvm/DebugInfo/PDB/Native/PDBFile.h
index 5e39ac3e37b7..56de4030167d 100644
--- a/include/llvm/DebugInfo/PDB/Native/PDBFile.h
+++ b/include/llvm/DebugInfo/PDB/Native/PDBFile.h
@@ -1,9 +1,8 @@
//===- PDBFile.h - Low level interface to a PDB file ------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -33,6 +32,7 @@ namespace pdb {
class DbiStream;
class GlobalsStream;
class InfoStream;
+class InjectedSourceStream;
class PDBStringTable;
class PDBFileBuilder;
class PublicsStream;
@@ -84,7 +84,12 @@ public:
ArrayRef<support::ulittle32_t> getDirectoryBlockArray() const;
- std::unique_ptr<msf::MappedBlockStream> createIndexedStream(uint16_t SN);
+ std::unique_ptr<msf::MappedBlockStream>
+ createIndexedStream(uint16_t SN) const;
+ Expected<std::unique_ptr<msf::MappedBlockStream>>
+ safelyCreateIndexedStream(uint32_t StreamIndex) const;
+ Expected<std::unique_ptr<msf::MappedBlockStream>>
+ safelyCreateNamedStream(StringRef Name);
msf::MSFStreamLayout getStreamLayout(uint32_t StreamIdx) const;
msf::MSFStreamLayout getFpmStreamLayout() const;
@@ -100,6 +105,7 @@ public:
Expected<PublicsStream &> getPDBPublicsStream();
Expected<SymbolStream &> getPDBSymbolStream();
Expected<PDBStringTable &> getStringTable();
+ Expected<InjectedSourceStream &> getInjectedSourceStream();
BumpPtrAllocator &getAllocator() { return Allocator; }
@@ -111,15 +117,11 @@ public:
bool hasPDBSymbolStream();
bool hasPDBTpiStream() const;
bool hasPDBStringTable();
+ bool hasPDBInjectedSourceStream();
uint32_t getPointerSize();
private:
- Expected<std::unique_ptr<msf::MappedBlockStream>>
- safelyCreateIndexedStream(const msf::MSFLayout &Layout,
- BinaryStreamRef MsfData,
- uint32_t StreamIndex) const;
-
std::string FilePath;
BumpPtrAllocator &Allocator;
@@ -136,6 +138,7 @@ private:
std::unique_ptr<SymbolStream> Symbols;
std::unique_ptr<msf::MappedBlockStream> DirectoryStream;
std::unique_ptr<msf::MappedBlockStream> StringTableStream;
+ std::unique_ptr<InjectedSourceStream> InjectedSources;
std::unique_ptr<PDBStringTable> Strings;
};
}
diff --git a/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h b/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
index 37458749a8d8..2abaa5f4cdc4 100644
--- a/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
@@ -1,9 +1,8 @@
//===- PDBFileBuilder.h - PDB File Creation ---------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -98,7 +97,7 @@ private:
PDBStringTableBuilder Strings;
StringTableHashTraits InjectedSourceHashTraits;
- HashTable<SrcHeaderBlockEntry, StringTableHashTraits> InjectedSourceTable;
+ HashTable<SrcHeaderBlockEntry> InjectedSourceTable;
SmallVector<InjectedSourceDescriptor, 2> InjectedSources;
diff --git a/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h b/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
index 29167c966d42..57f0b64a32a6 100644
--- a/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
+++ b/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
@@ -1,9 +1,8 @@
//===- PDBStringTable.h - PDB String Table -----------------------*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h b/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
index 0f81c18eafe6..57267ef5c6c5 100644
--- a/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
@@ -1,9 +1,8 @@
//===- PDBStringTableBuilder.h - PDB String Table Builder -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/llvm/DebugInfo/PDB/Native/PublicsStream.h b/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
index 2d0222a9071a..ee28d108df8b 100644
--- a/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
@@ -1,9 +1,8 @@
//===- PublicsStream.h - PDB Public Symbol Stream -------- ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/RawConstants.h b/include/llvm/DebugInfo/PDB/Native/RawConstants.h
index fbbd3318d958..0dde5ef66932 100644
--- a/include/llvm/DebugInfo/PDB/Native/RawConstants.h
+++ b/include/llvm/DebugInfo/PDB/Native/RawConstants.h
@@ -1,9 +1,8 @@
//===- RawConstants.h -------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/RawError.h b/include/llvm/DebugInfo/PDB/Native/RawError.h
index 97d11b4f20d1..aadb64c2e3f1 100644
--- a/include/llvm/DebugInfo/PDB/Native/RawError.h
+++ b/include/llvm/DebugInfo/PDB/Native/RawError.h
@@ -1,9 +1,8 @@
//===- RawError.h - Error extensions for raw PDB implementation -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/RawTypes.h b/include/llvm/DebugInfo/PDB/Native/RawTypes.h
index 8f6d6611c032..6119e6e5db26 100644
--- a/include/llvm/DebugInfo/PDB/Native/RawTypes.h
+++ b/include/llvm/DebugInfo/PDB/Native/RawTypes.h
@@ -1,9 +1,8 @@
//===- RawTypes.h -----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -177,7 +176,7 @@ struct DbiStreamHeader {
};
static_assert(sizeof(DbiStreamHeader) == 64, "Invalid DbiStreamHeader size!");
-/// The header preceeding the File Info Substream of the DBI stream.
+/// The header preceding the File Info Substream of the DBI stream.
struct FileInfoSubstreamHeader {
/// Total # of modules, should match number of records in the ModuleInfo
/// substream.
@@ -208,7 +207,7 @@ struct ModInfoFlags {
static const uint16_t TypeServerIndexShift = 8;
};
-/// The header preceeding each entry in the Module Info substream of the DBI
+/// The header preceding each entry in the Module Info substream of the DBI
/// stream. Corresponds to the type MODI in the reference implementation.
struct ModuleInfoHeader {
/// Currently opened module. This field is a pointer in the reference
@@ -273,7 +272,7 @@ struct PublicsStreamHeader {
support::ulittle32_t NumSections;
};
-// The header preceeding the global TPI stream.
+// The header preceding the global TPI stream.
// This corresponds to `HDR` in PDB/dbi/tpi.h.
struct TpiStreamHeader {
struct EmbeddedBuf {
@@ -301,7 +300,7 @@ struct TpiStreamHeader {
const uint32_t MinTpiHashBuckets = 0x1000;
const uint32_t MaxTpiHashBuckets = 0x40000;
-/// The header preceeding the global PDB Stream (Stream 1)
+/// The header preceding the global PDB Stream (Stream 1)
struct InfoStreamHeader {
support::ulittle32_t Version;
support::ulittle32_t Signature;
@@ -309,7 +308,7 @@ struct InfoStreamHeader {
codeview::GUID Guid;
};
-/// The header preceeding the /names stream.
+/// The header preceding the /names stream.
struct PDBStringTableHeader {
support::ulittle32_t Signature; // PDBStringTableSignature
support::ulittle32_t HashVersion; // 1 or 2
@@ -342,7 +341,6 @@ struct SrcHeaderBlockEntry {
short Padding; // Pad to 4 bytes.
char Reserved[8];
};
-
static_assert(sizeof(SrcHeaderBlockEntry) == 40, "Incorrect struct size!");
} // namespace pdb
diff --git a/include/llvm/DebugInfo/PDB/Native/SymbolCache.h b/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
index 08e1d41e6ee9..0b15ab474f71 100644
--- a/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
+++ b/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
@@ -1,9 +1,8 @@
//==- SymbolCache.h - Cache of native symbols and ids ------------*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/SymbolStream.h b/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
index ae9f7d657b70..4fe1bd9734e4 100644
--- a/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
@@ -1,9 +1,8 @@
//===- SymbolStream.cpp - PDB Symbol Stream Access --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/TpiHashing.h b/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
index c2996ccf1825..4ac60a80e701 100644
--- a/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
+++ b/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
@@ -1,9 +1,8 @@
//===- TpiHashing.h ---------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/TpiStream.h b/include/llvm/DebugInfo/PDB/Native/TpiStream.h
index b76576a7a263..1b7fd2d54cb2 100644
--- a/include/llvm/DebugInfo/PDB/Native/TpiStream.h
+++ b/include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -1,9 +1,8 @@
//===- TpiStream.cpp - PDB Type Info (TPI) Stream 2 Access ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h b/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
index 411720d6f56b..72d98e9c2c4d 100644
--- a/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
+++ b/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
@@ -1,9 +1,8 @@
//===- TpiStreamBuilder.h - PDB Tpi Stream Creation -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDB.h b/include/llvm/DebugInfo/PDB/PDB.h
index 9f9da39ca6cc..6d734dc2f243 100644
--- a/include/llvm/DebugInfo/PDB/PDB.h
+++ b/include/llvm/DebugInfo/PDB/PDB.h
@@ -1,9 +1,8 @@
//===- PDB.h - base header file for creating a PDB reader -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBContext.h b/include/llvm/DebugInfo/PDB/PDBContext.h
index 0ce49f5ef922..7b6793f0a639 100644
--- a/include/llvm/DebugInfo/PDB/PDBContext.h
+++ b/include/llvm/DebugInfo/PDB/PDBContext.h
@@ -1,9 +1,8 @@
//===-- PDBContext.h --------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===/
@@ -44,15 +43,18 @@ namespace pdb {
void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override;
DILineInfo getLineInfoForAddress(
- uint64_t Address,
+ object::SectionedAddress Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
DILineInfoTable getLineInfoForAddressRange(
- uint64_t Address, uint64_t Size,
+ object::SectionedAddress Address, uint64_t Size,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
DIInliningInfo getInliningInfoForAddress(
- uint64_t Address,
+ object::SectionedAddress Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
+ std::vector<DILocal>
+ getLocalsForAddress(object::SectionedAddress Address) override;
+
private:
std::string getFunctionName(uint64_t Address, DINameKind NameKind) const;
std::unique_ptr<IPDBSession> Session;
diff --git a/include/llvm/DebugInfo/PDB/PDBExtras.h b/include/llvm/DebugInfo/PDB/PDBExtras.h
index aaec71aa8c90..45aba013e7c8 100644
--- a/include/llvm/DebugInfo/PDB/PDBExtras.h
+++ b/include/llvm/DebugInfo/PDB/PDBExtras.h
@@ -1,9 +1,8 @@
//===- PDBExtras.h - helper functions and classes for PDBs ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -28,7 +27,8 @@ raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
-raw_ostream &operator<<(raw_ostream &OS, const codeview::RegisterId &Reg);
+raw_ostream &operator<<(raw_ostream &OS,
+ const llvm::codeview::CPURegister &CpuReg);
raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
raw_ostream &operator<<(raw_ostream &OS, const codeview::ThunkOrdinal &Thunk);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
@@ -37,13 +37,12 @@ raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
raw_ostream &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);
raw_ostream &operator<<(raw_ostream &OS, const PDB_UdtType &Type);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine);
-raw_ostream &operator<<(raw_ostream &OS,
- const PDB_SourceCompression &Compression);
raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
+raw_ostream& dumpPDBSourceCompression(raw_ostream& OS, uint32_t Compression);
template <typename T>
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent) {
diff --git a/include/llvm/DebugInfo/PDB/PDBSymDumper.h b/include/llvm/DebugInfo/PDB/PDBSymDumper.h
index c976935c48e0..f81b15f2353d 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymDumper.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymDumper.h
@@ -1,9 +1,8 @@
//===- PDBSymDumper.h - base interface for PDB symbol dumper *- C++ -----*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbol.h b/include/llvm/DebugInfo/PDB/PDBSymbol.h
index 3a74f7c3aace..d9004a8894d9 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbol.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbol.h
@@ -1,9 +1,8 @@
//===- PDBSymbol.h - base class for user-facing symbol types -----*- C++-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h b/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
index ef00df15cb0a..c76466a97b66 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
@@ -1,9 +1,8 @@
//===- PDBSymbolAnnotation.h - Accessors for querying PDB annotations ---*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOLANNOTATION_H
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h b/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
index 2cf9c72a8886..cf471450d989 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
@@ -1,9 +1,8 @@
//===- PDBSymbolBlock.h - Accessors for querying PDB blocks -------------*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOLBLOCK_H
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h b/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
index 04dbd962ebd4..ca8b39d03f86 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
@@ -1,9 +1,8 @@
//===- PDBSymbolCompiland.h - Accessors for querying PDB compilands -----*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOLCOMPILAND_H
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h b/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
index 3d651a464d94..b82bb6c0a352 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
@@ -1,9 +1,8 @@
//===- PDBSymbolCompilandDetails.h - PDB compiland details ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h b/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
index ffc408314d9a..61607a03593d 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
@@ -1,9 +1,8 @@
//===- PDBSymbolCompilandEnv.h - compiland environment variables *- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h b/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
index c29e4c31d3f3..75a86411643a 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
@@ -1,9 +1,8 @@
//===- PDBSymbolCustom.h - compiler-specific types --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolData.h b/include/llvm/DebugInfo/PDB/PDBSymbolData.h
index 217e1e976e6b..7e9b69d7cf4b 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolData.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolData.h
@@ -1,9 +1,8 @@
//===- PDBSymbolData.h - PDB data (e.g. variable) accessors -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolExe.h b/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
index 366d0cf4777f..1a9fb240a248 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
@@ -1,9 +1,8 @@
//===- PDBSymbolExe.h - Accessors for querying executables in a PDB ----*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h b/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
index 129e557c7f25..6be27c8d3bc7 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
@@ -1,9 +1,8 @@
//===- PDBSymbolFunc.h - class representing a function instance -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h b/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
index 18db8a50fd1b..7152249cbd03 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
@@ -1,9 +1,8 @@
//===- PDBSymbolFuncDebugEnd.h - function end bounds info -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h b/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
index 83d82f0cbcc5..3125c271d2e8 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
@@ -1,9 +1,8 @@
//===- PDBSymbolFuncDebugStart.h - function start bounds info ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h b/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
index 8b2617fcd757..3625e23f014f 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
@@ -1,9 +1,8 @@
//===- PDBSymbolLabel.h - label info ----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h b/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
index 9def3edb469a..e2b2545d78ec 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
@@ -1,9 +1,8 @@
//===- PDBSymbolPublicSymbol.h - public symbol info -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h b/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
index 7bb0555362db..274de8b0b16f 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
@@ -1,9 +1,8 @@
//===- PDBSymbolThunk.h - Support for querying PDB thunks ---------------*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
index 488f668bdc10..c0215c9ee4b1 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeArray.h - array type information ------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
index 550deedd7504..bab292ee0d46 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeBaseClass.h - base class type information ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
index e07e88802b8f..7d94c3c97a2b 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeBuiltin.h - builtin type information --------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
index 0d8979c9c5c5..dc647aff48d3 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeCustom.h - custom compiler type information -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
index 58292a63501f..7a9e43785d67 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeDimension.h - array dimension type info -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
index f463047bb5b5..3ac72801b202 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeEnum.h - enum type info ---------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
index 5b940b0737af..c4d9dd6308a3 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeFriend.h - friend type info -----------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
index 074cb418fc82..22d3623496f2 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeFunctionArg.h - function arg type info ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
index dfdf436197c3..a1491ca2e415 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeFunctionSig.h - function signature type info *- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
index d716abd640c6..6bc70bca82e7 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeManaged.h - managed type info ---------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
index 300d6722fc4d..b36f459e880c 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypePointer.h - pointer type info ---------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
index d6e2a36486d5..2712d0617e0e 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeTypedef.h - typedef type info ---------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
index 937dd6c87221..3e73ad7ac85a 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeUDT.h - UDT type info -----------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
index 6efce4bbd686..e8161d311ea7 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeVTable.h - VTable type info -----------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h b/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
index 8949052b0c0f..614060867042 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
@@ -1,9 +1,8 @@
//===- PDBSymbolTypeVTableShape.h - VTable shape info -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h b/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
index e935ac6ce0dc..cc29d38c2578 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
@@ -1,9 +1,8 @@
//===- PDBSymbolUnknown.h - unknown symbol type -----------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h b/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
index 4e8c99fc8d89..fd812cb2f793 100644
--- a/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
+++ b/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
@@ -1,9 +1,8 @@
//===- PDBSymbolUsingNamespace.h - using namespace info ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/PDB/PDBTypes.h b/include/llvm/DebugInfo/PDB/PDBTypes.h
index 917f3ed73910..c26d8d1ed10c 100644
--- a/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -1,9 +1,8 @@
//===- PDBTypes.h - Defines enums for various fields contained in PDB ----====//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -127,6 +126,7 @@ enum class PDB_Machine {
Am33 = 0x13,
Amd64 = 0x8664,
Arm = 0x1C0,
+ Arm64 = 0xaa64,
ArmNT = 0x1C4,
Ebc = 0xEBC,
x86 = 0x14C,
@@ -146,11 +146,69 @@ enum class PDB_Machine {
WceMipsV2 = 0x169
};
-enum class PDB_SourceCompression {
- None,
- RunLengthEncoded,
- Huffman,
- LZ,
+// A struct with an inner unnamed enum with explicit underlying type resuls
+// in an enum class that can implicitly convert to the underlying type, which
+// is convenient for this enum.
+struct PDB_SourceCompression {
+ enum : uint32_t {
+ // No compression. Produced e.g. by `link.exe /natvis:foo.natvis`.
+ None,
+ // Not known what produces this.
+ RunLengthEncoded,
+ // Not known what produces this.
+ Huffman,
+ // Not known what produces this.
+ LZ,
+ // Produced e.g. by `csc /debug`. The encoded data is its own mini-stream
+ // with the following layout (in little endian):
+ // GUID LanguageTypeGuid;
+ // GUID LanguageVendorGuid;
+ // GUID DocumentTypeGuid;
+ // GUID HashFunctionGuid;
+ // uint32_t HashDataSize;
+ // uint32_t CompressedDataSize;
+ // Followed by HashDataSize bytes containing a hash checksum,
+ // followed by CompressedDataSize bytes containing source contents.
+ //
+ // CompressedDataSize can be 0, in this case only the hash data is present.
+ // (CompressedDataSize is != 0 e.g. if `/embed` is passed to csc.exe.)
+ // The compressed data format is:
+ // uint32_t UncompressedDataSize;
+ // If UncompressedDataSize is 0, the data is stored uncompressed and
+ // CompressedDataSize stores the uncompressed size.
+ // If UncompressedDataSize is != 0, then the data is in raw deflate
+ // encoding as described in rfc1951.
+ //
+ // A GUID is 16 bytes, stored in the usual
+ // uint32_t
+ // uint16_t
+ // uint16_t
+ // uint8_t[24]
+ // layout.
+ //
+ // Well-known GUIDs for LanguageTypeGuid are:
+ // 63a08714-fc37-11d2-904c-00c04fa302a1 C
+ // 3a12d0b7-c26c-11d0-b442-00a0244a1dd2 C++
+ // 3f5162f8-07c6-11d3-9053-00c04fa302a1 C#
+ // af046cd1-d0e1-11d2-977c-00a0c9b4d50c Cobol
+ // ab4f38c9-b6e6-43ba-be3b-58080b2ccce3 F#
+ // 3a12d0b4-c26c-11d0-b442-00a0244a1dd2 Java
+ // 3a12d0b6-c26c-11d0-b442-00a0244a1dd2 JScript
+ // af046cd2-d0e1-11d2-977c-00a0c9b4d50c Pascal
+ // 3a12d0b8-c26c-11d0-b442-00a0244a1dd2 Visual Basic
+ //
+ // Well-known GUIDs for LanguageVendorGuid are:
+ // 994b45c4-e6e9-11d2-903f-00c04fa302a1 Microsoft
+ //
+ // Well-known GUIDs for DocumentTypeGuid are:
+ // 5a869d0b-6611-11d3-bd2a-0000f80849bd Text
+ //
+ // Well-known GUIDs for HashFunctionGuid are:
+ // 406ea660-64cf-4c82-b6f0-42d48172a799 MD5 (HashDataSize is 16)
+ // ff1816ec-aa5e-4d10-87f7-6f4963833460 SHA1 (HashDataSize is 20)
+ // 8829d00f-11b8-4213-878b-770e8597ac16 SHA256 (HashDataSize is 32)
+ DotNet = 101,
+ };
};
/// These values correspond to the CV_call_e enumeration, and are documented
diff --git a/include/llvm/DebugInfo/PDB/UDTLayout.h b/include/llvm/DebugInfo/PDB/UDTLayout.h
index c4234c191e21..c67b093b63c0 100644
--- a/include/llvm/DebugInfo/PDB/UDTLayout.h
+++ b/include/llvm/DebugInfo/PDB/UDTLayout.h
@@ -1,9 +1,8 @@
//===- UDTLayout.h - UDT layout info ----------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/DebugInfo/Symbolize/DIPrinter.h b/include/llvm/DebugInfo/Symbolize/DIPrinter.h
index ab82be3706d8..db7a61a8f160 100644
--- a/include/llvm/DebugInfo/Symbolize/DIPrinter.h
+++ b/include/llvm/DebugInfo/Symbolize/DIPrinter.h
@@ -1,9 +1,8 @@
//===- llvm/DebugInfo/Symbolize/DIPrinter.h ---------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -21,15 +20,22 @@ namespace llvm {
struct DILineInfo;
class DIInliningInfo;
struct DIGlobal;
+struct DILocal;
namespace symbolize {
class DIPrinter {
+public:
+ enum class OutputStyle { LLVM, GNU };
+
+private:
raw_ostream &OS;
bool PrintFunctionNames;
bool PrintPretty;
int PrintSourceContext;
bool Verbose;
+ bool Basenames;
+ OutputStyle Style;
void print(const DILineInfo &Info, bool Inlined);
void printContext(const std::string &FileName, int64_t Line);
@@ -37,14 +43,16 @@ class DIPrinter {
public:
DIPrinter(raw_ostream &OS, bool PrintFunctionNames = true,
bool PrintPretty = false, int PrintSourceContext = 0,
- bool Verbose = false)
+ bool Verbose = false, bool Basenames = false,
+ OutputStyle Style = OutputStyle::LLVM)
: OS(OS), PrintFunctionNames(PrintFunctionNames),
PrintPretty(PrintPretty), PrintSourceContext(PrintSourceContext),
- Verbose(Verbose) {}
+ Verbose(Verbose), Basenames(Basenames), Style(Style) {}
DIPrinter &operator<<(const DILineInfo &Info);
DIPrinter &operator<<(const DIInliningInfo &Info);
DIPrinter &operator<<(const DIGlobal &Global);
+ DIPrinter &operator<<(const DILocal &Local);
};
}
}
diff --git a/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h b/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
index e576a91e887c..506ecc424b4c 100644
--- a/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
+++ b/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
@@ -1,9 +1,8 @@
//===- SymbolizableModule.h -------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -25,13 +24,16 @@ class SymbolizableModule {
public:
virtual ~SymbolizableModule() = default;
- virtual DILineInfo symbolizeCode(uint64_t ModuleOffset,
+ virtual DILineInfo symbolizeCode(object::SectionedAddress ModuleOffset,
FunctionNameKind FNKind,
bool UseSymbolTable) const = 0;
- virtual DIInliningInfo symbolizeInlinedCode(uint64_t ModuleOffset,
- FunctionNameKind FNKind,
- bool UseSymbolTable) const = 0;
- virtual DIGlobal symbolizeData(uint64_t ModuleOffset) const = 0;
+ virtual DIInliningInfo
+ symbolizeInlinedCode(object::SectionedAddress ModuleOffset,
+ FunctionNameKind FNKind, bool UseSymbolTable) const = 0;
+ virtual DIGlobal
+ symbolizeData(object::SectionedAddress ModuleOffset) const = 0;
+ virtual std::vector<DILocal>
+ symbolizeFrame(object::SectionedAddress ModuleOffset) const = 0;
// Return true if this is a 32-bit x86 PE COFF module.
virtual bool isWin32Module() const = 0;
diff --git a/include/llvm/DebugInfo/Symbolize/Symbolize.h b/include/llvm/DebugInfo/Symbolize/Symbolize.h
index 289148f569db..d3da28ca0b7b 100644
--- a/include/llvm/DebugInfo/Symbolize/Symbolize.h
+++ b/include/llvm/DebugInfo/Symbolize/Symbolize.h
@@ -1,9 +1,8 @@
//===- Symbolize.h ----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -36,35 +35,35 @@ using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
class LLVMSymbolizer {
public:
struct Options {
- FunctionNameKind PrintFunctions;
- bool UseSymbolTable : 1;
- bool Demangle : 1;
- bool RelativeAddresses : 1;
+ FunctionNameKind PrintFunctions = FunctionNameKind::LinkageName;
+ bool UseSymbolTable = true;
+ bool Demangle = true;
+ bool RelativeAddresses = false;
std::string DefaultArch;
std::vector<std::string> DsymHints;
-
- Options(FunctionNameKind PrintFunctions = FunctionNameKind::LinkageName,
- bool UseSymbolTable = true, bool Demangle = true,
- bool RelativeAddresses = false, std::string DefaultArch = "")
- : PrintFunctions(PrintFunctions), UseSymbolTable(UseSymbolTable),
- Demangle(Demangle), RelativeAddresses(RelativeAddresses),
- DefaultArch(std::move(DefaultArch)) {}
+ std::string FallbackDebugPath;
+ std::string DWPName;
};
- LLVMSymbolizer(const Options &Opts = Options()) : Opts(Opts) {}
+ LLVMSymbolizer() = default;
+ LLVMSymbolizer(const Options &Opts) : Opts(Opts) {}
~LLVMSymbolizer() {
flush();
}
+ Expected<DILineInfo> symbolizeCode(const ObjectFile &Obj,
+ object::SectionedAddress ModuleOffset);
Expected<DILineInfo> symbolizeCode(const std::string &ModuleName,
- uint64_t ModuleOffset,
- StringRef DWPName = "");
- Expected<DIInliningInfo> symbolizeInlinedCode(const std::string &ModuleName,
- uint64_t ModuleOffset,
- StringRef DWPName = "");
+ object::SectionedAddress ModuleOffset);
+ Expected<DIInliningInfo>
+ symbolizeInlinedCode(const std::string &ModuleName,
+ object::SectionedAddress ModuleOffset);
Expected<DIGlobal> symbolizeData(const std::string &ModuleName,
- uint64_t ModuleOffset);
+ object::SectionedAddress ModuleOffset);
+ Expected<std::vector<DILocal>>
+ symbolizeFrame(const std::string &ModuleName,
+ object::SectionedAddress ModuleOffset);
void flush();
static std::string
@@ -74,14 +73,23 @@ public:
private:
// Bundles together object file with code/data and object file with
// corresponding debug info. These objects can be the same.
- using ObjectPair = std::pair<ObjectFile *, ObjectFile *>;
+ using ObjectPair = std::pair<const ObjectFile *, const ObjectFile *>;
+
+ Expected<DILineInfo>
+ symbolizeCodeCommon(SymbolizableModule *Info,
+ object::SectionedAddress ModuleOffset);
/// Returns a SymbolizableModule or an error if loading debug info failed.
/// Only one attempt is made to load a module, and errors during loading are
/// only reported once. Subsequent calls to get module info for a module that
/// failed to load will return nullptr.
Expected<SymbolizableModule *>
- getOrCreateModuleInfo(const std::string &ModuleName, StringRef DWPName = "");
+ getOrCreateModuleInfo(const std::string &ModuleName);
+
+ Expected<SymbolizableModule *>
+ createModuleInfo(const ObjectFile *Obj,
+ std::unique_ptr<DIContext> Context,
+ StringRef ModuleName);
ObjectFile *lookUpDsymFile(const std::string &Path,
const MachOObjectFile *ExeObj,