check if a method has the same name as the type and rename

This commit is contained in:
Andreia Gaita 2011-01-31 06:17:56 +00:00
Родитель dee7bc63c2
Коммит a0ee2b75f7
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -23,6 +23,7 @@ namespace Mono.VisualC.Code.Atoms {
public CppType RetType { get; set; }
public IList<NameTypePair<CppType>> Parameters { get; set; }
public Class Klass { get; set; }
private string formatted_name;
@ -284,6 +285,8 @@ namespace Mono.VisualC.Code.Atoms {
sb.Append (Name [i]);
}
formatted_name = sb.ToString ();
if (formatted_name == Klass.Name)
formatted_name += "1";
}
return formatted_name;
}

Просмотреть файл

@ -328,8 +328,15 @@ namespace Mono.VisualC.Tools.Generator {
retType = replaceType (retType, templated.Types[i], genericTypeArgs[i]);
}
var methodAtom = new Method (dtor ? "Destruct" : mname) { RetType = retType, IsVirtual = member.IsTrue ("virtual"), IsStatic = member.IsTrue ("static"), IsConst = member.IsTrue ("const"), IsConstructor = ctor, IsDestructor = dtor };
var methodAtom = new Method (dtor ? "Destruct" : mname) {
RetType = retType,
IsVirtual = member.IsTrue ("virtual"),
IsStatic = member.IsTrue ("static"),
IsConst = member.IsTrue ("const"),
IsConstructor = ctor,
IsDestructor = dtor,
Klass = clas.Class
};
if (AbiTest)
methodAtom.Mangled = new NameTypePair<Type> { Name = member.attributes["mangled"], Type = typeof(ItaniumAbi) };