Skip to content

Commit cbd8349

Browse files
authored
Update license headers in new files (#47669)
* Update license headers in new files * Run dotnet-format on changeset
1 parent d199ebf commit cbd8349

File tree

11 files changed

+388
-385
lines changed

11 files changed

+388
-385
lines changed

src/coreclr/ToolBox/SOS/DIALib/DIALib.il

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
3-
// See the LICENSE file in the project root for more information.
43

54
// Metadata version: v4.0.30319
65
.assembly extern mscorlib

src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageContainer.cs

Lines changed: 228 additions & 221 deletions
Large diffs are not rendered by default.
Lines changed: 80 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
3-
// See the LICENSE file in the project root for more information.
43

54
using System;
65
using System.Linq;
@@ -10,89 +9,98 @@
109

1110
namespace Mono.Linker
1211
{
13-
public readonly struct MessageOrigin : IComparable<MessageOrigin>, IEquatable<MessageOrigin>
14-
{
12+
public readonly struct MessageOrigin : IComparable<MessageOrigin>, IEquatable<MessageOrigin>
13+
{
1514
#nullable enable
16-
public string? FileName { get; }
17-
public IMemberDefinition? MemberDefinition { get; }
15+
public string? FileName { get; }
16+
public IMemberDefinition? MemberDefinition { get; }
1817
#nullable disable
19-
public int SourceLine { get; }
20-
public int SourceColumn { get; }
21-
public int? ILOffset { get; }
18+
public int SourceLine { get; }
19+
public int SourceColumn { get; }
20+
public int? ILOffset { get; }
2221

23-
public MessageOrigin (string fileName, int sourceLine = 0, int sourceColumn = 0)
24-
{
25-
FileName = fileName;
26-
SourceLine = sourceLine;
27-
SourceColumn = sourceColumn;
28-
MemberDefinition = null;
29-
ILOffset = null;
30-
}
22+
public MessageOrigin(string fileName, int sourceLine = 0, int sourceColumn = 0)
23+
{
24+
FileName = fileName;
25+
SourceLine = sourceLine;
26+
SourceColumn = sourceColumn;
27+
MemberDefinition = null;
28+
ILOffset = null;
29+
}
3130

32-
public MessageOrigin (IMemberDefinition memberDefinition, int? ilOffset = null)
33-
{
34-
FileName = null;
35-
MemberDefinition = memberDefinition;
36-
SourceLine = 0;
37-
SourceColumn = 0;
38-
ILOffset = ilOffset;
39-
}
31+
public MessageOrigin(IMemberDefinition memberDefinition, int? ilOffset = null)
32+
{
33+
FileName = null;
34+
MemberDefinition = memberDefinition;
35+
SourceLine = 0;
36+
SourceColumn = 0;
37+
ILOffset = ilOffset;
38+
}
4039

41-
public override string ToString ()
42-
{
43-
int sourceLine = SourceLine, sourceColumn = SourceColumn;
44-
string fileName = FileName;
45-
if (MemberDefinition is MethodDefinition method &&
46-
method.DebugInformation.HasSequencePoints) {
47-
var offset = ILOffset ?? 0;
48-
SequencePoint correspondingSequencePoint = method.DebugInformation.SequencePoints
49-
.Where (s => s.Offset <= offset)?.Last ();
50-
if (correspondingSequencePoint != null) {
51-
fileName = correspondingSequencePoint.Document.Url;
52-
sourceLine = correspondingSequencePoint.StartLine;
53-
sourceColumn = correspondingSequencePoint.StartColumn;
54-
}
55-
}
40+
public override string ToString()
41+
{
42+
int sourceLine = SourceLine, sourceColumn = SourceColumn;
43+
string fileName = FileName;
44+
if (MemberDefinition is MethodDefinition method &&
45+
method.DebugInformation.HasSequencePoints)
46+
{
47+
var offset = ILOffset ?? 0;
48+
SequencePoint correspondingSequencePoint = method.DebugInformation.SequencePoints
49+
.Where(s => s.Offset <= offset)?.Last();
50+
if (correspondingSequencePoint != null)
51+
{
52+
fileName = correspondingSequencePoint.Document.Url;
53+
sourceLine = correspondingSequencePoint.StartLine;
54+
sourceColumn = correspondingSequencePoint.StartColumn;
55+
}
56+
}
5657

57-
if (fileName == null)
58-
return null;
58+
if (fileName == null)
59+
return null;
5960

60-
StringBuilder sb = new StringBuilder (fileName);
61-
if (sourceLine != 0) {
62-
sb.Append ("(").Append (sourceLine);
63-
if (sourceColumn != 0)
64-
sb.Append (",").Append (sourceColumn);
61+
StringBuilder sb = new StringBuilder(fileName);
62+
if (sourceLine != 0)
63+
{
64+
sb.Append("(").Append(sourceLine);
65+
if (sourceColumn != 0)
66+
sb.Append(",").Append(sourceColumn);
6567

66-
sb.Append (")");
67-
}
68+
sb.Append(")");
69+
}
6870

69-
return sb.ToString ();
70-
}
71+
return sb.ToString();
72+
}
7173

72-
public bool Equals (MessageOrigin other) =>
73-
(FileName, MemberDefinition, SourceLine, SourceColumn) == (other.FileName, other.MemberDefinition, other.SourceLine, other.SourceColumn);
74+
public bool Equals(MessageOrigin other) =>
75+
(FileName, MemberDefinition, SourceLine, SourceColumn) == (other.FileName, other.MemberDefinition, other.SourceLine, other.SourceColumn);
7476

75-
public override bool Equals (object obj) => obj is MessageOrigin messageOrigin && Equals (messageOrigin);
76-
public override int GetHashCode () => (FileName, MemberDefinition, SourceLine, SourceColumn).GetHashCode ();
77-
public static bool operator == (MessageOrigin lhs, MessageOrigin rhs) => lhs.Equals (rhs);
78-
public static bool operator != (MessageOrigin lhs, MessageOrigin rhs) => !lhs.Equals (rhs);
77+
public override bool Equals(object obj) => obj is MessageOrigin messageOrigin && Equals(messageOrigin);
78+
public override int GetHashCode() => (FileName, MemberDefinition, SourceLine, SourceColumn).GetHashCode();
79+
public static bool operator ==(MessageOrigin lhs, MessageOrigin rhs) => lhs.Equals(rhs);
80+
public static bool operator !=(MessageOrigin lhs, MessageOrigin rhs) => !lhs.Equals(rhs);
7981

80-
public int CompareTo (MessageOrigin other)
81-
{
82-
if (MemberDefinition != null && other.MemberDefinition != null) {
83-
return (MemberDefinition.DeclaringType?.Module?.Assembly?.Name?.Name, MemberDefinition.DeclaringType?.Name, MemberDefinition?.Name).CompareTo
84-
((other.MemberDefinition.DeclaringType?.Module?.Assembly?.Name?.Name, other.MemberDefinition.DeclaringType?.Name, other.MemberDefinition?.Name));
85-
} else if (MemberDefinition == null && other.MemberDefinition == null) {
86-
if (FileName != null && other.FileName != null) {
87-
return string.Compare (FileName, other.FileName);
88-
} else if (FileName == null && other.FileName == null) {
89-
return (SourceLine, SourceColumn).CompareTo ((other.SourceLine, other.SourceColumn));
90-
}
82+
public int CompareTo(MessageOrigin other)
83+
{
84+
if (MemberDefinition != null && other.MemberDefinition != null)
85+
{
86+
return (MemberDefinition.DeclaringType?.Module?.Assembly?.Name?.Name, MemberDefinition.DeclaringType?.Name, MemberDefinition?.Name).CompareTo
87+
((other.MemberDefinition.DeclaringType?.Module?.Assembly?.Name?.Name, other.MemberDefinition.DeclaringType?.Name, other.MemberDefinition?.Name));
88+
}
89+
else if (MemberDefinition == null && other.MemberDefinition == null)
90+
{
91+
if (FileName != null && other.FileName != null)
92+
{
93+
return string.Compare(FileName, other.FileName);
94+
}
95+
else if (FileName == null && other.FileName == null)
96+
{
97+
return (SourceLine, SourceColumn).CompareTo((other.SourceLine, other.SourceColumn));
98+
}
9199

92-
return (FileName == null) ? 1 : -1;
93-
}
100+
return (FileName == null) ? 1 : -1;
101+
}
94102

95-
return (MemberDefinition == null) ? 1 : -1;
96-
}
97-
}
103+
return (MemberDefinition == null) ? 1 : -1;
104+
}
105+
}
98106
}

src/coreclr/tools/Common/Pgo/PgoFormat.cs

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
3-
// See the LICENSE file in the project root for more information.
43

54
using System;
6-
using System.Diagnostics;
5+
using System.Collections;
76
using System.Collections.Generic;
8-
using ILCompiler;
7+
using System.Diagnostics;
98
using System.Text.RegularExpressions;
10-
using System.Collections;
9+
using ILCompiler;
1110

1211
namespace Internal.Pgo
1312
{
@@ -240,7 +239,7 @@ public static IEnumerable<PgoSchemaElem> ParsePgoData<TType>(IPgoSchemaDataLoade
240239
else
241240
{
242241
int dataIndex = curSchema.Count - dataCountToRead;
243-
switch(curSchema.InstrumentationKind & PgoInstrumentationKind.MarshalMask)
242+
switch (curSchema.InstrumentationKind & PgoInstrumentationKind.MarshalMask)
244243
{
245244
case PgoInstrumentationKind.FourByte:
246245
if (longsAreCompressed)
@@ -332,7 +331,7 @@ public static IEnumerable<PgoSchemaElem> ParsePgoData<TType>(IPgoSchemaDataLoade
332331
case PgoInstrumentationKind.None:
333332
yield return curSchema;
334333
break;
335-
334+
336335
case PgoInstrumentationKind.FourByte:
337336
if (curSchema.Count > 1)
338337
{
@@ -414,42 +413,42 @@ public static void EncodePgoData<TType>(IEnumerable<PgoSchemaElem> schemas, IPgo
414413
case PgoInstrumentationKind.None:
415414
break;
416415
case PgoInstrumentationKind.FourByte:
417-
{
418-
long valueToEmit;
419-
if (schema.Count == 1)
420-
{
421-
valueToEmit = schema.DataLong;
422-
}
423-
else
424416
{
425-
valueToEmit = ((int[])schema.DataObject)[i];
417+
long valueToEmit;
418+
if (schema.Count == 1)
419+
{
420+
valueToEmit = schema.DataLong;
421+
}
422+
else
423+
{
424+
valueToEmit = ((int[])schema.DataObject)[i];
425+
}
426+
valueEmitter.EmitLong(valueToEmit, prevEmittedIntData);
427+
prevEmittedIntData = valueToEmit;
428+
break;
426429
}
427-
valueEmitter.EmitLong(valueToEmit, prevEmittedIntData);
428-
prevEmittedIntData = valueToEmit;
429-
break;
430-
}
431430
case PgoInstrumentationKind.EightByte:
432-
{
433-
long valueToEmit;
434-
if (schema.Count == 1)
435431
{
436-
valueToEmit = schema.DataLong;
432+
long valueToEmit;
433+
if (schema.Count == 1)
434+
{
435+
valueToEmit = schema.DataLong;
436+
}
437+
else
438+
{
439+
valueToEmit = ((long[])schema.DataObject)[i];
440+
}
441+
valueEmitter.EmitLong(valueToEmit, prevEmittedIntData);
442+
prevEmittedIntData = valueToEmit;
443+
break;
437444
}
438-
else
445+
case PgoInstrumentationKind.TypeHandle:
439446
{
440-
valueToEmit = ((long[])schema.DataObject)[i];
447+
TType typeToEmit = ((TType[])schema.DataObject)[i];
448+
valueEmitter.EmitType(typeToEmit, prevEmittedType);
449+
prevEmittedType = typeToEmit;
450+
break;
441451
}
442-
valueEmitter.EmitLong(valueToEmit, prevEmittedIntData);
443-
prevEmittedIntData = valueToEmit;
444-
break;
445-
}
446-
case PgoInstrumentationKind.TypeHandle:
447-
{
448-
TType typeToEmit = ((TType[])schema.DataObject)[i];
449-
valueEmitter.EmitType(typeToEmit, prevEmittedType);
450-
prevEmittedType = typeToEmit;
451-
break;
452-
}
453452
}
454453
}
455454

@@ -559,43 +558,43 @@ void MergeInSchemaElem(Dictionary<PgoSchemaElem, PgoSchemaElem> dataMerger, PgoS
559558

560559
switch (existingSchemaItem.InstrumentationKind)
561560
{
562-
case PgoInstrumentationKind.BasicBlockIntCount:
563-
case PgoInstrumentationKind.TypeHandleHistogramCount:
564-
if ((existingSchemaItem.Count != 1) || (schema.Count != 1))
565-
{
566-
throw new Exception("Unable to merge pgo data. Invalid format");
567-
}
568-
mergedElem.DataLong = existingSchemaItem.DataLong + schema.DataLong;
569-
break;
570-
571-
case PgoInstrumentationKind.TypeHandleHistogramTypeHandle:
572-
{
573-
mergedElem.Count = existingSchemaItem.Count + schema.Count;
574-
TType[] newMergedTypeArray = new TType[mergedElem.Count];
575-
mergedElem.DataObject = newMergedTypeArray;
576-
int i = 0;
577-
foreach (TType type in (TType[])existingSchemaItem.DataObject)
561+
case PgoInstrumentationKind.BasicBlockIntCount:
562+
case PgoInstrumentationKind.TypeHandleHistogramCount:
563+
if ((existingSchemaItem.Count != 1) || (schema.Count != 1))
578564
{
579-
newMergedTypeArray[i++] = type;
565+
throw new Exception("Unable to merge pgo data. Invalid format");
580566
}
581-
foreach (TType type in (TType[])schema.DataObject)
567+
mergedElem.DataLong = existingSchemaItem.DataLong + schema.DataLong;
568+
break;
569+
570+
case PgoInstrumentationKind.TypeHandleHistogramTypeHandle:
582571
{
583-
newMergedTypeArray[i++] = type;
572+
mergedElem.Count = existingSchemaItem.Count + schema.Count;
573+
TType[] newMergedTypeArray = new TType[mergedElem.Count];
574+
mergedElem.DataObject = newMergedTypeArray;
575+
int i = 0;
576+
foreach (TType type in (TType[])existingSchemaItem.DataObject)
577+
{
578+
newMergedTypeArray[i++] = type;
579+
}
580+
foreach (TType type in (TType[])schema.DataObject)
581+
{
582+
newMergedTypeArray[i++] = type;
583+
}
584+
break;
584585
}
585-
break;
586-
}
587586

588-
case PgoInstrumentationKind.Version:
589-
{
590-
mergedElem.Other = Math.Max(existingSchemaItem.Other, schema.Other);
591-
break;
592-
}
587+
case PgoInstrumentationKind.Version:
588+
{
589+
mergedElem.Other = Math.Max(existingSchemaItem.Other, schema.Other);
590+
break;
591+
}
593592

594-
case PgoInstrumentationKind.NumRuns:
595-
{
596-
mergedElem.Other = existingSchemaItem.Other + schema.Other;
597-
break;
598-
}
593+
case PgoInstrumentationKind.NumRuns:
594+
{
595+
mergedElem.Other = existingSchemaItem.Other + schema.Other;
596+
break;
597+
}
599598
}
600599

601600
Debug.Assert(PgoSchemaMergeComparer.Singleton.Compare(schema, mergedElem) == 0);

src/installer/pkg/sfx/installers/osx_scripts/host/postinstall

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
# Licensed to the .NET Foundation under one or more agreements.
44
# The .NET Foundation licenses this file to you under the MIT license.
5-
# See the LICENSE file in the project root for more information.
65
#
76

87
PACKAGE=$1

src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
# Licensed to the .NET Foundation under one or more agreements.
44
# The .NET Foundation licenses this file to you under the MIT license.
5-
# See the LICENSE file in the project root for more information.
65
#
76

87
PACKAGE=$1

0 commit comments

Comments
 (0)