Permalink
Browse files

Deleted pointless indexation of overloads.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information...
ddobrev committed Jul 15, 2017
1 parent 351bae6 commit 40e6abbd221db717a52da51ab75b6ba115346c41
@@ -144,7 +144,6 @@ public Function()
Parameters = new List<Parameter>();
CallingConvention = CallingConvention.Default;
Signature = string.Empty;
Index = null;
}
public Function(Function function)
@@ -163,7 +162,6 @@ public Function(Function function)
SynthKind = function.SynthKind;
OriginalFunction = function.OriginalFunction;
Mangled = function.Mangled;
Index = function.Index;
Signature = function.Signature;
FunctionType = function.FunctionType;
if (function.SpecializationInfo != null)
@@ -249,11 +247,6 @@ public QualifiedType OriginalReturnType
/// </summary>
public Field Field { get; set; }
/// <summary>
/// Keeps an index that de-duplicates native names in the C# backend.
/// </summary>
public uint? Index { get; set; }
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitFunctionDecl(this);
@@ -3049,18 +3049,10 @@ public static string GetFunctionIdentifier(Function function)
if (overloads.Count > 1)
index = overloads.IndexOf(function);
if (index >= 0)
{
if (index > 0)
{
identifier.Append('_');
identifier.Append(index.ToString(CultureInfo.InvariantCulture));
}
}
else if (function.Index.HasValue)
if (index > 0)
{
identifier.Append('_');
identifier.Append(function.Index.Value);
identifier.Append(index.ToString(CultureInfo.InvariantCulture));
}
return identifier.ToString();
@@ -179,15 +179,6 @@ public override bool VisitClassDecl(Class @class)
foreach (var property in @class.Properties)
VisitProperty(property);
var total = (uint)0;
foreach (var method in @class.Methods.Where(m => m.IsConstructor &&
!m.IsCopyConstructor && !m.IsMoveConstructor))
method.Index = total++;
total = 0;
foreach (var method in @class.Methods.Where(m => m.IsCopyConstructor))
method.Index = total++;
return false;
}

0 comments on commit 40e6abb

Please sign in to comment.