summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-03-26 15:38:33 +0000
committerReid Kleckner <reid@kleckner.net>2014-03-26 15:38:33 +0000
commit597e81dea1059c8a075f29f5fcadcb1ae58e42e3 (patch)
tree8f062e22ab2752e2074986c5e059dc808c26763d /clang/lib/CodeGen/CGBuiltin.cpp
parentc491a8d4577052bc6b3b4c72a7db6a7cfcbc2ed0 (diff)
downloadbcm5719-llvm-597e81dea1059c8a075f29f5fcadcb1ae58e42e3.tar.gz
bcm5719-llvm-597e81dea1059c8a075f29f5fcadcb1ae58e42e3.zip
-fms-extensions: Add __va_start builtin, which is used for x64
The main difference between __va_start and __builtin_va_start is that the address of the va_list has already been taken, and the va_list is always a char*. __va_end and __va_arg are not needed. llvm-svn: 204821
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index c105d80bf79..b0e63b647d8 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -215,8 +215,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
return RValue::get(CGM.EmitConstantExpr(E, E->getType(), 0));
case Builtin::BI__builtin_stdarg_start:
case Builtin::BI__builtin_va_start:
+ case Builtin::BI__va_start:
case Builtin::BI__builtin_va_end: {
- Value *ArgValue = EmitVAListRef(E->getArg(0));
+ Value *ArgValue = (BuiltinID == Builtin::BI__va_start)
+ ? EmitScalarExpr(E->getArg(0))
+ : EmitVAListRef(E->getArg(0));
llvm::Type *DestType = Int8PtrTy;
if (ArgValue->getType() != DestType)
ArgValue = Builder.CreateBitCast(ArgValue, DestType,
OpenPOWER on IntegriCloud