diff options
author | Chris Lattner <sabre@nondot.org> | 2008-09-28 06:05:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-09-28 06:05:35 +0000 |
commit | 037379d767d3c26f25430c6555c7f844931b7e65 (patch) | |
tree | e11d50c422d3231eb49c3acc9c237338b03461fe /clang/lib/AST/Builtins.cpp | |
parent | ff2c187e591f029dbda5966349f7f283a7de72ef (diff) | |
download | bcm5719-llvm-037379d767d3c26f25430c6555c7f844931b7e65.tar.gz bcm5719-llvm-037379d767d3c26f25430c6555c7f844931b7e65.zip |
Fix rdar://6252231 - cannot call vsnprintf with va_list on x86_64,
by decaying __builtin_va_list's type when forming builtins. On
x86-64 (and other targets) __builtin_va_list is a typedef for
an array.
llvm-svn: 56768
Diffstat (limited to 'clang/lib/AST/Builtins.cpp')
-rw-r--r-- | clang/lib/AST/Builtins.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/Builtins.cpp b/clang/lib/AST/Builtins.cpp index 8249c4119d6..31e099af4ee 100644 --- a/clang/lib/AST/Builtins.cpp +++ b/clang/lib/AST/Builtins.cpp @@ -137,6 +137,9 @@ static QualType DecodeTypeFromStr(const char *&Str, ASTContext &Context, case 'a': Type = Context.getBuiltinVaListType(); assert(!Type.isNull() && "builtin va list type not initialized!"); + // Do array -> pointer decay. The builtin should use the decayed type. + if (Type->isArrayType()) + Type = Context.getArrayDecayedType(Type); break; case 'V': { char *End; |