[llvm] r350520 - [CodeView] More appropriate name and type for a Microsoft precompiled headers parameter. NFC
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 7 05:53:16 PST 2019
Author: aganea
Date: Mon Jan 7 05:53:16 2019
New Revision: 350520
URL: http://llvm.org/viewvc/llvm-project?rev=350520&view=rev
Log:
[CodeView] More appropriate name and type for a Microsoft precompiled headers parameter. NFC
Modified:
llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
llvm/trunk/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h?rev=350520&r1=350519&r2=350520&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h Mon Jan 7 05:53:16 2019
@@ -84,20 +84,20 @@ Error mergeTypeAndIdRecords(MergingTypeT
MergingTypeTableBuilder &DestTypes,
SmallVectorImpl<TypeIndex> &SourceToDest,
const CVTypeArray &IdsAndTypes,
- Optional<EndPrecompRecord> &EndPrecomp);
+ Optional<uint32_t> &PCHSignature);
Error mergeTypeAndIdRecords(GlobalTypeTableBuilder &DestIds,
GlobalTypeTableBuilder &DestTypes,
SmallVectorImpl<TypeIndex> &SourceToDest,
const CVTypeArray &IdsAndTypes,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EndPrecomp);
+ Optional<uint32_t> &PCHSignature);
Error mergeTypeRecords(GlobalTypeTableBuilder &Dest,
SmallVectorImpl<TypeIndex> &SourceToDest,
const CVTypeArray &Types,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EndPrecomp);
+ Optional<uint32_t> &PCHSignature);
Error mergeIdRecords(GlobalTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
SmallVectorImpl<TypeIndex> &SourceToDest,
Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeStreamMerger.cpp?rev=350520&r1=350519&r2=350520&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/TypeStreamMerger.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/TypeStreamMerger.cpp Mon Jan 7 05:53:16 2019
@@ -77,8 +77,7 @@ public:
// Local hashing entry points
Error mergeTypesAndIds(MergingTypeTableBuilder &DestIds,
MergingTypeTableBuilder &DestTypes,
- const CVTypeArray &IdsAndTypes,
- Optional<EndPrecompRecord> &EP);
+ const CVTypeArray &IdsAndTypes, Optional<uint32_t> &S);
Error mergeIdRecords(MergingTypeTableBuilder &Dest,
ArrayRef<TypeIndex> TypeSourceToDest,
const CVTypeArray &Ids);
@@ -90,14 +89,14 @@ public:
GlobalTypeTableBuilder &DestTypes,
const CVTypeArray &IdsAndTypes,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EP);
+ Optional<uint32_t> &S);
Error mergeIdRecords(GlobalTypeTableBuilder &Dest,
ArrayRef<TypeIndex> TypeSourceToDest,
const CVTypeArray &Ids,
ArrayRef<GloballyHashedType> Hashes);
Error mergeTypeRecords(GlobalTypeTableBuilder &Dest, const CVTypeArray &Types,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EP);
+ Optional<uint32_t> &S);
private:
Error doit(const CVTypeArray &Types);
@@ -197,7 +196,7 @@ private:
/// its type indices.
SmallVector<uint8_t, 256> RemapStorage;
- Optional<EndPrecompRecord> EndPrecomp;
+ Optional<uint32_t> PCHSignature;
};
} // end anonymous namespace
@@ -275,12 +274,12 @@ Error TypeStreamMerger::mergeIdRecords(M
Error TypeStreamMerger::mergeTypesAndIds(MergingTypeTableBuilder &DestIds,
MergingTypeTableBuilder &DestTypes,
const CVTypeArray &IdsAndTypes,
- Optional<EndPrecompRecord> &EP) {
+ Optional<uint32_t> &S) {
DestIdStream = &DestIds;
DestTypeStream = &DestTypes;
UseGlobalHashes = false;
auto Err = doit(IdsAndTypes);
- EP = EndPrecomp;
+ S = PCHSignature;
return Err;
}
@@ -288,12 +287,12 @@ Error TypeStreamMerger::mergeTypesAndIds
Error TypeStreamMerger::mergeTypeRecords(GlobalTypeTableBuilder &Dest,
const CVTypeArray &Types,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EP) {
+ Optional<uint32_t> &S) {
DestGlobalTypeStream = &Dest;
UseGlobalHashes = true;
GlobalHashes = Hashes;
auto Err = doit(Types);
- EP = EndPrecomp;
+ S = PCHSignature;
return Err;
}
@@ -313,13 +312,13 @@ Error TypeStreamMerger::mergeTypesAndIds
GlobalTypeTableBuilder &DestTypes,
const CVTypeArray &IdsAndTypes,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EP) {
+ Optional<uint32_t> &S) {
DestGlobalIdStream = &DestIds;
DestGlobalTypeStream = &DestTypes;
UseGlobalHashes = true;
GlobalHashes = Hashes;
auto Err = doit(IdsAndTypes);
- EP = EndPrecomp;
+ S = PCHSignature;
return Err;
}
@@ -445,28 +444,27 @@ Error llvm::codeview::mergeIdRecords(Mer
Error llvm::codeview::mergeTypeAndIdRecords(
MergingTypeTableBuilder &DestIds, MergingTypeTableBuilder &DestTypes,
SmallVectorImpl<TypeIndex> &SourceToDest, const CVTypeArray &IdsAndTypes,
- Optional<EndPrecompRecord> &EndPrecomp) {
+ Optional<uint32_t> &PCHSignature) {
TypeStreamMerger M(SourceToDest);
- return M.mergeTypesAndIds(DestIds, DestTypes, IdsAndTypes, EndPrecomp);
+ return M.mergeTypesAndIds(DestIds, DestTypes, IdsAndTypes, PCHSignature);
}
Error llvm::codeview::mergeTypeAndIdRecords(
GlobalTypeTableBuilder &DestIds, GlobalTypeTableBuilder &DestTypes,
SmallVectorImpl<TypeIndex> &SourceToDest, const CVTypeArray &IdsAndTypes,
- ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EndPrecomp) {
+ ArrayRef<GloballyHashedType> Hashes, Optional<uint32_t> &PCHSignature) {
TypeStreamMerger M(SourceToDest);
return M.mergeTypesAndIds(DestIds, DestTypes, IdsAndTypes, Hashes,
- EndPrecomp);
+ PCHSignature);
}
Error llvm::codeview::mergeTypeRecords(GlobalTypeTableBuilder &Dest,
SmallVectorImpl<TypeIndex> &SourceToDest,
const CVTypeArray &Types,
ArrayRef<GloballyHashedType> Hashes,
- Optional<EndPrecompRecord> &EndPrecomp) {
+ Optional<uint32_t> &PCHSignature) {
TypeStreamMerger M(SourceToDest);
- return M.mergeTypeRecords(Dest, Types, Hashes, EndPrecomp);
+ return M.mergeTypeRecords(Dest, Types, Hashes, PCHSignature);
}
Error llvm::codeview::mergeIdRecords(GlobalTypeTableBuilder &Dest,
@@ -483,11 +481,13 @@ Expected<bool> TypeStreamMerger::shouldR
// signature, through EndPrecompRecord. This is done here for performance
// reasons, to avoid re-parsing the Types stream.
if (Type.kind() == LF_ENDPRECOMP) {
- assert(!EndPrecomp);
- EndPrecomp.emplace();
+ EndPrecompRecord EP;
if (auto EC = TypeDeserializer::deserializeAs(const_cast<CVType &>(Type),
- EndPrecomp.getValue()))
+ EP))
return joinErrors(std::move(EC), errorCorruptRecord());
+ if (PCHSignature.hasValue())
+ return errorCorruptRecord();
+ PCHSignature.emplace(EP.getSignature());
return false;
}
return true;
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=350520&r1=350519&r2=350520&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Mon Jan 7 05:53:16 2019
@@ -1248,9 +1248,9 @@ void COFFDumper::mergeCodeViewTypes(Merg
error(object_error::parse_failed);
}
SmallVector<TypeIndex, 128> SourceToDest;
- Optional<EndPrecompRecord> EndPrecomp;
+ Optional<uint32_t> PCHSignature;
if (auto EC = mergeTypeAndIdRecords(CVIDs, CVTypes, SourceToDest, Types,
- EndPrecomp))
+ PCHSignature))
return error(std::move(EC));
}
}
More information about the llvm-commits
mailing list