Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Add dependency tracking to string constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed Jun 18, 2018
1 parent 8867cf2 commit af496fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/System.Private.CoreLib/src/System/String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public sealed partial class String : IComparable, IEnumerable, IEnumerable<char>
// declared constructors.

[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char[])")]
public extern String(char[] value);

[System.Runtime.CompilerServices.DependencyReductionRoot]
Expand All @@ -105,6 +106,7 @@ private static String Ctor(char[] value)
}

[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char[], System.Int32, System.Int32)")]
public extern String(char[] value, int startIndex, int length);

[System.Runtime.CompilerServices.DependencyReductionRoot]
Expand Down Expand Up @@ -141,6 +143,7 @@ private static String Ctor(char[] value, int startIndex, int length)

[CLSCompliant(false)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char*)")]
unsafe public extern String(char* value);

[System.Runtime.CompilerServices.DependencyReductionRoot]
Expand Down Expand Up @@ -173,6 +176,7 @@ private static unsafe String Ctor(char* ptr)

[CLSCompliant(false)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char*, System.Int32, System.Int32)")]
unsafe public extern String(char* value, int startIndex, int length);

[System.Runtime.CompilerServices.DependencyReductionRoot]
Expand Down Expand Up @@ -214,6 +218,7 @@ private static unsafe String Ctor(char* ptr, int startIndex, int length)

[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.SByte*)")]
public extern unsafe String(sbyte* value);

[DependencyReductionRoot]
Expand All @@ -232,6 +237,7 @@ private static unsafe string Ctor(sbyte* value)

[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.SByte*, System.Int32, System.Int32)")]
public extern unsafe String(sbyte* value, int startIndex, int length);

[DependencyReductionRoot]
Expand Down Expand Up @@ -284,6 +290,7 @@ private static unsafe string CreateStringForSByteConstructor(byte *pb, int numBy

[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.SByte*, System.Int32, System.Int32, System.Text.Encoding)")]
public extern unsafe String(sbyte* value, int startIndex, int length, Encoding enc);

[DependencyReductionRoot]
Expand Down Expand Up @@ -329,6 +336,7 @@ private static unsafe string Ctor(sbyte* value, int startIndex, int length, Enco
}

[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char, System.Int32)")]
public extern String(char c, int count);

[System.Runtime.CompilerServices.DependencyReductionRoot]
Expand Down Expand Up @@ -376,6 +384,7 @@ private static String Ctor(char c, int count)
}

[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.ReadOnlySpan`1<System.Char>)")]
public extern String(ReadOnlySpan<char> value);

[DependencyReductionRoot]
Expand Down

0 comments on commit af496fc

Please sign in to comment.