diff options
| author | Michael Liao <michael.hliao@gmail.com> | 2019-10-24 11:41:11 -0400 |
|---|---|---|
| committer | Michael Liao <michael.hliao@gmail.com> | 2019-10-25 00:39:24 -0400 |
| commit | 5a48678a6a1619fada23641a68c2d95ee57806b1 (patch) | |
| tree | 5d18343e2ad58239094b29042e1404f233ccca78 /clang/lib/CodeGen | |
| parent | 0eb8a52aeec00472e50796f020da54ac709b8640 (diff) | |
| download | bcm5719-llvm-5a48678a6a1619fada23641a68c2d95ee57806b1.tar.gz bcm5719-llvm-5a48678a6a1619fada23641a68c2d95ee57806b1.zip | |
[hip] Allow the declaration of functions with variadic arguments in HIP.
Summary:
- As variadic parameters have the lowest rank in overload resolution,
without real usage of `va_arg`, they are commonly used as the
catch-all fallbacks in SFINAE. As the front-end still reports errors
on calls to `va_arg`, the declaration of functions with variadic
arguments should be allowed in general.
Reviewers: jlebar, tra, yaxunl
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69389
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index c2c7b8bf653..e33d69c86b3 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -7694,6 +7694,8 @@ public: ABIArgInfo classifyArgumentType(QualType Ty, unsigned &NumRegsLeft) const; void computeInfo(CGFunctionInfo &FI) const override; + Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, + QualType Ty) const override; }; bool AMDGPUABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { @@ -7757,6 +7759,11 @@ void AMDGPUABIInfo::computeInfo(CGFunctionInfo &FI) const { } } +Address AMDGPUABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, + QualType Ty) const { + llvm_unreachable("AMDGPU does not support varargs"); +} + ABIArgInfo AMDGPUABIInfo::classifyReturnType(QualType RetTy) const { if (isAggregateTypeForABI(RetTy)) { // Records with non-trivial destructors/copy-constructors should not be |

