diff options
author | Erich Keane <erich.keane@intel.com> | 2017-11-02 21:08:00 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-11-02 21:08:00 +0000 |
commit | 05b45eab313143ee8429824208c42f30e24bb013 (patch) | |
tree | 0fece87273a9257224d74716feaaac91e28924e3 /lib/Frontend/CompilerInvocation.cpp | |
parent | 603490dae39300a191e0485ce192a46176267397 (diff) | |
download | clang-05b45eab313143ee8429824208c42f30e24bb013.tar.gz |
Add default calling convention support for regcall.
Added support for regcall as default calling convention. Also added code to
exclude main when applying default calling conventions.
Patch-By: eandrews
Differential Revision: https://reviews.llvm.org/D39210
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 2c0d99b4be..692b20bd3a 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -2310,12 +2310,12 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, // Check for MS default calling conventions being specified. if (Arg *A = Args.getLastArg(OPT_fdefault_calling_conv_EQ)) { LangOptions::DefaultCallingConvention DefaultCC = - llvm::StringSwitch<LangOptions::DefaultCallingConvention>( - A->getValue()) + llvm::StringSwitch<LangOptions::DefaultCallingConvention>(A->getValue()) .Case("cdecl", LangOptions::DCC_CDecl) .Case("fastcall", LangOptions::DCC_FastCall) .Case("stdcall", LangOptions::DCC_StdCall) .Case("vectorcall", LangOptions::DCC_VectorCall) + .Case("regcall", LangOptions::DCC_RegCall) .Default(LangOptions::DCC_None); if (DefaultCC == LangOptions::DCC_None) Diags.Report(diag::err_drv_invalid_value) @@ -2326,7 +2326,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, bool emitError = (DefaultCC == LangOptions::DCC_FastCall || DefaultCC == LangOptions::DCC_StdCall) && Arch != llvm::Triple::x86; - emitError |= DefaultCC == LangOptions::DCC_VectorCall && + emitError |= (DefaultCC == LangOptions::DCC_VectorCall || + DefaultCC == LangOptions::DCC_RegCall) && !(Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64); if (emitError) Diags.Report(diag::err_drv_argument_not_allowed_with) |