-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Clang][Cygwin] Use correct BuiltinVaListKind. #143166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This was in older patches for Cygwin support, but was somehow lost in the latest rounds.
@llvm/pr-subscribers-clang Author: None (jeremyd2019) ChangesThis was in older patches for Cygwin support, but was somehow lost in the latest rounds. Full diff: https://github.com/llvm/llvm-project/pull/143166.diff 1 Files Affected:
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 3d58be8f898c6..b3fe98c5c742f 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -984,6 +984,10 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
this->WCharType = TargetInfo::UnsignedShort;
}
+ BuiltinVaListKind getBuiltinVaListKind() const override {
+ return TargetInfo::CharPtrBuiltinVaList;
+ }
+
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
X86_64TargetInfo::getTargetDefines(Opts, Builder);
|
The change looks good, but can we have a test for it in some form? |
I don't know - it's easy enough to do in vivo #include <stdio.h>
#include <stdarg.h>
void test(const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
int main(void)
{
test("asdf %d %s\n", 1, 1==1 ? "TEST" : "TESTS");
return 0;
} Before this change
After
|
I'm not seeing an obvious place for a target-specific va_list test, can you suggest where this would go? |
No idea offhand; I tried breaking the existing
So some of them may contain a good sample for tests that cover this bit. |
None of those really cry out to me as a place to extend with a cygwin test... but adding a new test in CodeGen that validates that the va_list works the same on windows and cygwin based on the existing tests wouldn't be too hard. |
I have a test already: #143115 |
This was in older patches for Cygwin support, but was somehow lost in the latest rounds.