File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -935,6 +935,16 @@ class VarArgsCallingConvention extends CallingConvention {
935935 override string toString ( ) { result = "VarArgsCallingConvention" }
936936}
937937
938+ /**
939+ * Unmanaged calling convention that indicates that the specifics
940+ * are encoded as modopts.
941+ */
942+ class UnmanagedCallingConvention extends CallingConvention {
943+ UnmanagedCallingConvention ( ) { this = MkCallingConvention ( 9 ) }
944+
945+ override string toString ( ) { result = "UnmanagedCallingConvention" }
946+ }
947+
938948/**
939949 * A function pointer type, for example
940950 *
Original file line number Diff line number Diff line change @@ -513,12 +513,30 @@ private string stubClassName(Type t) {
513513 stubClassName ( element ) , "," order by i
514514 ) + ")"
515515 else
516- if t instanceof ValueOrRefType
516+ if t instanceof FunctionPointerType
517517 then
518- result =
519- stubQualifiedNamePrefix ( t ) + t .getUndecoratedName ( ) +
520- stubGenericArguments ( t )
521- else result = "<error>"
518+ exists ( CallingConvention callconvention , string calltext |
519+ callconvention = t .( FunctionPointerType ) .getCallingConvention ( ) and
520+ (
521+ if callconvention instanceof UnmanagedCallingConvention
522+ then calltext = "unmanaged"
523+ else calltext = ""
524+ ) and
525+ result =
526+ "delegate* " + calltext + "<" +
527+ concat ( int i , Parameter p |
528+ p = t .( FunctionPointerType ) .getParameter ( i )
529+ |
530+ stubClassName ( p .getType ( ) ) + "," order by i
531+ ) + stubClassName ( t .( FunctionPointerType ) .getReturnType ( ) ) + ">"
532+ )
533+ else
534+ if t instanceof ValueOrRefType
535+ then
536+ result =
537+ stubQualifiedNamePrefix ( t ) + t .getUndecoratedName ( ) +
538+ stubGenericArguments ( t )
539+ else result = "<error>"
522540}
523541
524542language [ monotonicAggregates]
You can’t perform that action at this time.
0 commit comments