File tree Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -935,6 +935,16 @@ class VarArgsCallingConvention extends CallingConvention {
935
935
override string toString ( ) { result = "VarArgsCallingConvention" }
936
936
}
937
937
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
+
938
948
/**
939
949
* A function pointer type, for example
940
950
*
Original file line number Diff line number Diff line change @@ -513,12 +513,30 @@ private string stubClassName(Type t) {
513
513
stubClassName ( element ) , "," order by i
514
514
) + ")"
515
515
else
516
- if t instanceof ValueOrRefType
516
+ if t instanceof FunctionPointerType
517
517
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>"
522
540
}
523
541
524
542
language [ monotonicAggregates]
You can’t perform that action at this time.
0 commit comments