|
|
|
@ -23,27 +23,20 @@ namespace CppSharp.Passes
@@ -23,27 +23,20 @@ namespace CppSharp.Passes
|
|
|
|
|
if (!FunctionToInstanceMethodPass.GetClassParameter(param, out @class)) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
function.ExplicityIgnored = true; |
|
|
|
|
|
|
|
|
|
// Create a new fake method so it acts as a static method.
|
|
|
|
|
var method = new Method() |
|
|
|
|
|
|
|
|
|
var method = new Method(function) |
|
|
|
|
{ |
|
|
|
|
Namespace = @class, |
|
|
|
|
OriginalNamespace = @class, |
|
|
|
|
Name = function.Name, |
|
|
|
|
OriginalName = function.OriginalName, |
|
|
|
|
Mangled = function.Mangled, |
|
|
|
|
Access = AccessSpecifier.Public, |
|
|
|
|
Kind = CXXMethodKind.Operator, |
|
|
|
|
ReturnType = function.ReturnType, |
|
|
|
|
Parameters = new List<Parameter>(function.Parameters).Skip(1).ToList(), |
|
|
|
|
CallingConvention = function.CallingConvention, |
|
|
|
|
IsVariadic = function.IsVariadic, |
|
|
|
|
IsInline = function.IsInline, |
|
|
|
|
OperatorKind = function.OperatorKind, |
|
|
|
|
SynthKind = FunctionSynthKind.NonMemberOperator |
|
|
|
|
SynthKind = FunctionSynthKind.NonMemberOperator, |
|
|
|
|
OriginalFunction = null, |
|
|
|
|
IsStatic = true |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function.ExplicityIgnored = true; |
|
|
|
|
|
|
|
|
|
@class.Methods.Add(method); |
|
|
|
|
|
|
|
|
|
Driver.Diagnostics.Debug("Function converted to operator: {0}::{1}", |
|
|
|
|