aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-10-10 00:05:45 +0000
committerReid Kleckner <reid@kleckner.net>2014-10-10 00:05:45 +0000
commit79b0fd7a489c9aa793b3dab80ce78819f887fa0c (patch)
tree0465b8346f6328316f2a8c487e33a5a55b9cf9ef /clang/lib/CodeGen/CodeGenFunction.h
parentdf782e42296db1b73a03fc7a445361eb82363594 (diff)
downloadllvm-79b0fd7a489c9aa793b3dab80ce78819f887fa0c.zip
llvm-79b0fd7a489c9aa793b3dab80ce78819f887fa0c.tar.gz
llvm-79b0fd7a489c9aa793b3dab80ce78819f887fa0c.tar.bz2
Promote null pointer constants used as arguments to variadic functions
Make it possible to pass NULL through variadic functions on 64-bit Windows targets. The Visual C++ headers define NULL to 0, when they should define it to 0LL on Win64 so that NULL is a pointer-sized integer. Fixes PR20949. Reviewers: thakis, rsmith Differential Revision: http://reviews.llvm.org/D5480 llvm-svn: 219456
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 11d2b04..1c5111a5 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2752,7 +2752,7 @@ public:
// If we still have any arguments, emit them using the type of the argument.
for (; Arg != ArgEnd; ++Arg)
- ArgTypes.push_back(Arg->getType());
+ ArgTypes.push_back(getVarArgType(*Arg));
EmitCallArgs(Args, ArgTypes, ArgBeg, ArgEnd, CalleeDecl, ParamsToSkip,
ForceColumnInfo);
@@ -2765,6 +2765,8 @@ public:
unsigned ParamsToSkip = 0, bool ForceColumnInfo = false);
private:
+ QualType getVarArgType(const Expr *Arg);
+
const TargetCodeGenInfo &getTargetHooks() const {
return CGM.getTargetCodeGenInfo();
}