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 | a957ffbce3920d7c07eb1c73ee616c4e96d57be0 (patch) | |
tree | e617693bc21960d9cbbd36e74971ef58b4f78e7c /clang/lib/AST/ASTContext.cpp | |
parent | f2593d028fbaea554a6f499eb535b54e6d3b297a (diff) | |
download | bcm5719-llvm-a957ffbce3920d7c07eb1c73ee616c4e96d57be0.tar.gz bcm5719-llvm-a957ffbce3920d7c07eb1c73ee616c4e96d57be0.zip |
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
llvm-svn: 317268
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 87d096dab00..8247d1a23ef 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -9281,6 +9281,11 @@ CallingConv ASTContext::getDefaultCallingConvention(bool IsVariadic, if (!IsVariadic) return CC_X86VectorCall; break; + case LangOptions::DCC_RegCall: + // __regcall cannot be applied to variadic functions. + if (!IsVariadic) + return CC_X86RegCall; + break; } return Target->getDefaultCallingConv(TargetInfo::CCMT_Unknown); } |