提交 79c8f750 编写于 作者: T Tomas Matousek

Minor tweaks based on PR feedback

上级 1ad4b581
......@@ -2508,7 +2508,7 @@ internal void EnsureAnonymousTypeTemplates(CancellationToken cancellationToken)
metadataStream,
ilStream,
(nativePdbWriterOpt == null) ? pdbStream : null,
out var metadataSizes);
out MetadataSizes metadataSizes);
writer.GetMethodTokens(updatedMethods);
......
......@@ -51,7 +51,7 @@ internal sealed class DeltaMetadataWriter : MetadataWriter
SymbolChanges changes,
CancellationToken cancellationToken)
: base(metadata: MakeTablesBuilder(previousGeneration),
debugMetadataOpt: (context.Module.EmitOptions.DebugInformationFormat != DebugInformationFormat.Pdb) ? new MetadataBuilder() : null,
debugMetadataOpt: (context.Module.EmitOptions.DebugInformationFormat == DebugInformationFormat.PortablePdb) ? new MetadataBuilder() : null,
dynamicAnalysisDataWriterOpt: null,
context: context,
messageProvider: messageProvider,
......@@ -62,6 +62,7 @@ internal sealed class DeltaMetadataWriter : MetadataWriter
Debug.Assert(previousGeneration != null);
Debug.Assert(encId != default(Guid));
Debug.Assert(encId != previousGeneration.EncId);
Debug.Assert(context.Module.EmitOptions.DebugInformationFormat != DebugInformationFormat.Embedded);
_previousGeneration = previousGeneration;
_encId = encId;
......
......@@ -1809,7 +1809,8 @@ public void WriteMetadataAndIL(PdbWriter nativePdbWriterOpt, Stream metadataStre
public void PopulateEncTables(ImmutableArray<int> typeSystemRowCounts)
{
Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncLog] == 0 && typeSystemRowCounts[(int)TableIndex.EncMap] == 0);
Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncLog] == 0);
Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncMap] == 0);
PopulateEncLogTableRows(typeSystemRowCounts);
PopulateEncMapTableRows(typeSystemRowCounts);
......
......@@ -1270,8 +1270,8 @@ private void WriteSequencePoints(ImmutableArray<SymUnmanagedSequencePoint> seque
private unsafe ImmutableArray<MethodDefinitionHandle> BuildMethodTokenMap()
{
if (!(_symReader is ISymUnmanagedReader5 symReader5) ||
symReader5.GetPortableDebugMetadata(out byte* metadata, out int size) != 0)
if (!(_symReader is ISymUnmanagedReader4 symReader4) ||
symReader4.GetPortableDebugMetadata(out byte* metadata, out int size) != 0)
{
return ImmutableArray<MethodDefinitionHandle>.Empty;
}
......
......@@ -32,17 +32,17 @@ internal sealed class CompilationDifference
public CompilationDifference(
ImmutableArray<byte> metadata,
ImmutableArray<byte> il,
ImmutableArray<byte> pdbStream,
ImmutableArray<byte> pdb,
CompilationTestData testData,
EmitDifferenceResult result,
ImmutableArray<MethodDefinitionHandle> methodHandles)
{
this.MetadataDelta = metadata;
this.ILDelta = il;
this.PdbDelta = pdbStream;
this.TestData = testData;
this.EmitResult = result;
this.UpdatedMethods = methodHandles;
MetadataDelta = metadata;
ILDelta = il;
PdbDelta = pdb;
TestData = testData;
EmitResult = result;
UpdatedMethods = methodHandles;
}
public EmitBaseline NextGeneration
......
......@@ -146,14 +146,13 @@ public static class PdbValidation
Assert.True(actualIsPortable);
// SymWriter doesn't create empty scopes. When the C# compiler uses forwarding CDI instead of a NamespaceScope
// the scope is actually not empty - it logically contains the imports. Portable PDB does not used forwarding and thus
// the scope is actually not empty - it logically contains the imports. Portable PDB does not use forwarding and thus
// creates the scope. When generating PDB XML for testing the Portable DiaSymReader returns empty namespaces.
RemoveEmptyScopes(actualPdb);
// if the actual format is portable and the expected is not, remove native-only artifacts:
RemoveNonPortablePdb(expectedPdb);
// TODO: remove
RemoveEmptySequencePoints(expectedPdb);
// remove scopes that only contained non-portable elements (namespace scopes)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册