diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-02-22 19:17:40 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-02-22 19:17:40 +0000 |
commit | 1fcd10ca4e7ee7a38193ef58446ff04e7708f1d7 (patch) | |
tree | 196c0da937064a10601a4c675feccae363ec29be /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 32b6222bc366a424d21811fec576644a9ce53009 (diff) | |
download | bcm5719-llvm-1fcd10ca4e7ee7a38193ef58446ff04e7708f1d7.tar.gz bcm5719-llvm-1fcd10ca4e7ee7a38193ef58446ff04e7708f1d7.zip |
[WebAssembly] Lower va_arg in clang.
This uses the general emitVoidPtrVAArg lowering logic for everything, since
this supports all types, and we don't have any special requirements.
llvm-svn: 261557
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 7a122772a49..f19f31584f0 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -616,6 +616,9 @@ private: for (auto &Arg : FI.arguments()) Arg.info = classifyArgumentType(Arg.type); } + + Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, + QualType Ty) const override; }; class WebAssemblyTargetCodeGenInfo final : public TargetCodeGenInfo { @@ -667,6 +670,14 @@ ABIArgInfo WebAssemblyABIInfo::classifyReturnType(QualType RetTy) const { return DefaultABIInfo::classifyReturnType(RetTy); } +Address WebAssemblyABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, + QualType Ty) const { + return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect=*/ false, + getContext().getTypeInfoInChars(Ty), + CharUnits::fromQuantity(4), + /*AllowHigherAlign=*/ true); +} + //===----------------------------------------------------------------------===// // le32/PNaCl bitcode ABI Implementation // |