-
Notifications
You must be signed in to change notification settings - Fork 0
/
callingconv_gen.go
81 lines (75 loc) · 2.92 KB
/
callingconv_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package clang
// #include "./clang-c/Index.h"
// #include "go-clang.h"
import "C"
import "fmt"
// Describes the calling convention of a function type
type CallingConv uint32
const (
CallingConv_Default CallingConv = C.CXCallingConv_Default
CallingConv_C = C.CXCallingConv_C
CallingConv_X86StdCall = C.CXCallingConv_X86StdCall
CallingConv_X86FastCall = C.CXCallingConv_X86FastCall
CallingConv_X86ThisCall = C.CXCallingConv_X86ThisCall
CallingConv_X86Pascal = C.CXCallingConv_X86Pascal
CallingConv_AAPCS = C.CXCallingConv_AAPCS
CallingConv_AAPCS_VFP = C.CXCallingConv_AAPCS_VFP
CallingConv_X86RegCall = C.CXCallingConv_X86RegCall
CallingConv_IntelOclBicc = C.CXCallingConv_IntelOclBicc
CallingConv_Win64 = C.CXCallingConv_Win64
CallingConv_X86_64Win64 = C.CXCallingConv_X86_64Win64
CallingConv_X86_64SysV = C.CXCallingConv_X86_64SysV
CallingConv_X86VectorCall = C.CXCallingConv_X86VectorCall
CallingConv_Swift = C.CXCallingConv_Swift
CallingConv_PreserveMost = C.CXCallingConv_PreserveMost
CallingConv_PreserveAll = C.CXCallingConv_PreserveAll
CallingConv_AArch64VectorCall = C.CXCallingConv_AArch64VectorCall
CallingConv_Invalid = C.CXCallingConv_Invalid
CallingConv_Unexposed = C.CXCallingConv_Unexposed
)
func (cc CallingConv) Spelling() string {
switch cc {
case CallingConv_Default:
return "CallingConv=Default"
case CallingConv_C:
return "CallingConv=C"
case CallingConv_X86StdCall:
return "CallingConv=X86StdCall"
case CallingConv_X86FastCall:
return "CallingConv=X86FastCall"
case CallingConv_X86ThisCall:
return "CallingConv=X86ThisCall"
case CallingConv_X86Pascal:
return "CallingConv=X86Pascal"
case CallingConv_AAPCS:
return "CallingConv=AAPCS"
case CallingConv_AAPCS_VFP:
return "CallingConv=AAPCS_VFP"
case CallingConv_X86RegCall:
return "CallingConv=X86RegCall"
case CallingConv_IntelOclBicc:
return "CallingConv=IntelOclBicc"
case CallingConv_Win64:
return "CallingConv=Win64, X86_64Win64"
case CallingConv_X86_64SysV:
return "CallingConv=X86_64SysV"
case CallingConv_X86VectorCall:
return "CallingConv=X86VectorCall"
case CallingConv_Swift:
return "CallingConv=Swift"
case CallingConv_PreserveMost:
return "CallingConv=PreserveMost"
case CallingConv_PreserveAll:
return "CallingConv=PreserveAll"
case CallingConv_AArch64VectorCall:
return "CallingConv=AArch64VectorCall"
case CallingConv_Invalid:
return "CallingConv=Invalid"
case CallingConv_Unexposed:
return "CallingConv=Unexposed"
}
return fmt.Sprintf("CallingConv unknown %d", int(cc))
}
func (cc CallingConv) String() string {
return cc.Spelling()
}