Skip to content

Commit c6dd031

Browse files
committed
set calling conv list
1 parent 7289f2c commit c6dd031

File tree

1 file changed

+29
-0
lines changed
  • clang/lib/Basic/Targets

1 file changed

+29
-0
lines changed

clang/lib/Basic/Targets/X86.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
983983
: X86_64TargetInfo(Triple, Opts) {
984984
this->WCharType = TargetInfo::UnsignedShort;
985985
this->WIntType = TargetInfo::UnsignedInt;
986+
this->UseMicrosoftManglingForC = true;
986987
}
987988

988989
void getTargetDefines(const LangOptions &Opts,
@@ -997,9 +998,37 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
997998
Builder.defineMacro("_GNU_SOURCE");
998999
}
9991000

1001+
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
1002+
switch (CC) {
1003+
case CC_X86StdCall:
1004+
case CC_X86ThisCall:
1005+
case CC_X86FastCall:
1006+
return CCCR_Ignore;
1007+
case CC_C:
1008+
case CC_X86VectorCall:
1009+
case CC_IntelOclBicc:
1010+
case CC_PreserveMost:
1011+
case CC_PreserveAll:
1012+
case CC_PreserveNone:
1013+
case CC_X86_64SysV:
1014+
case CC_Swift:
1015+
case CC_SwiftAsync:
1016+
case CC_X86RegCall:
1017+
case CC_DeviceKernel:
1018+
return CCCR_OK;
1019+
default:
1020+
return CCCR_Warning;
1021+
}
1022+
}
1023+
10001024
BuiltinVaListKind getBuiltinVaListKind() const override {
10011025
return TargetInfo::CharPtrBuiltinVaList;
10021026
}
1027+
1028+
TargetInfo::CallingConvKind
1029+
getCallingConvKind(bool ClangABICompat4) const override {
1030+
return CCK_MicrosoftWin64;
1031+
}
10031032
};
10041033

10051034
class LLVM_LIBRARY_VISIBILITY DarwinX86_64TargetInfo

0 commit comments

Comments
 (0)