[PATCH] D1623: Support __builtin_ms_va_list.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 10 20:28:56 PDT 2015
rsmith added inline comments.
================
Comment at: lib/Sema/SemaExpr.cpp:11664-11672
@@ -11662,1 +11663,11 @@
+
+ // It might be a __builtin_ms_va_list.
+ if (!E->isTypeDependent() && Context.getTargetInfo().hasBuiltinMSVaList()) {
+ QualType MSVaListType = Context.getBuiltinMSVaListType();
+ if (Context.hasSameType(MSVaListType, E->getType())) {
+ if (CheckForModifiableLvalue(E, BuiltinLoc, *this))
+ return ExprError();
+ IsMS = true;
+ }
+ }
----------------
If `__builtin_va_list` and `__builtin_ms_va_list` are the same type, this will set `IsMS` to true, which is not wrong per se but seems a bit surprising. (`IsMS` is the "I'm using an unnatural ABI" flag, and I think it'd be a bit better to not set it for normal `va_start` / `va_arg` / `va_end`, even when targeting the MS ABI. Thoughts?
http://reviews.llvm.org/D1623
More information about the cfe-commits
mailing list