https://github.com/dyung created https://github.com/llvm/llvm-project/pull/101752
Reverts llvm/llvm-project#100837 The test Modules/builtin-vararg.c is failing on AArch64 build bots: - https://lab.llvm.org/buildbot/#/builders/190/builds/3117 - https://lab.llvm.org/buildbot/#/builders/65/builds/2302 - https://lab.llvm.org/buildbot/#/builders/154/builds/2288 Revert to get the bots back to green. >From bb3735133316e15405961ecfd8def854eca4c36e Mon Sep 17 00:00:00 2001 From: dyung <douglas.y...@sony.com> Date: Fri, 2 Aug 2024 14:07:55 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"[Modules]=20Fix=20using=20`va=5Flist`?= =?UTF-8?q?=20with=20modules=20and=20a=20precompiled=20header.=20=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d02757ce9ee3b439ba8cb7a67676e725a22a8651. --- clang/lib/Sema/Sema.cpp | 7 --- clang/test/Modules/builtin-vararg.c | 83 ----------------------------- 2 files changed, 90 deletions(-) delete mode 100644 clang/test/Modules/builtin-vararg.c diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 19d8692ee6484..2e989f0ba6fe4 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -310,13 +310,6 @@ void Sema::addImplicitTypedef(StringRef Name, QualType T) { } void Sema::Initialize() { - // Create BuiltinVaListDecl *before* ExternalSemaSource::InitializeSema(this) - // because during initialization ASTReader can emit globals that require - // name mangling. And the name mangling uses BuiltinVaListDecl. - if (Context.getTargetInfo().hasBuiltinMSVaList()) - (void)Context.getBuiltinMSVaListDecl(); - (void)Context.getBuiltinVaListDecl(); - if (SemaConsumer *SC = dyn_cast<SemaConsumer>(&Consumer)) SC->InitializeSema(*this); diff --git a/clang/test/Modules/builtin-vararg.c b/clang/test/Modules/builtin-vararg.c deleted file mode 100644 index ed6e6aeb6e50f..0000000000000 --- a/clang/test/Modules/builtin-vararg.c +++ /dev/null @@ -1,83 +0,0 @@ -// Check how builtins using varargs behave with the modules. - -// RUN: rm -rf %t -// RUN: split-file %s %t - -// RUN: %clang_cc1 -triple x86_64-apple-darwin \ -// RUN: -fmodules -fno-implicit-modules -fbuiltin-headers-in-system-modules \ -// RUN: -emit-module -fmodule-name=DeclareVarargs \ -// RUN: -x c %t/include/module.modulemap -o %t/DeclareVarargs.pcm \ -// RUN: -fmodule-map-file=%t/resource_dir/module.modulemap -isystem %t/resource_dir -// RUN: %clang_cc1 -triple x86_64-apple-darwin \ -// RUN: -fmodules -fno-implicit-modules -fbuiltin-headers-in-system-modules \ -// RUN: -emit-pch -fmodule-name=Prefix \ -// RUN: -x c-header %t/prefix.pch -o %t/prefix.pch.gch \ -// RUN: -fmodule-map-file=%t/include/module.modulemap -fmodule-file=DeclareVarargs=%t/DeclareVarargs.pcm \ -// RUN: -I %t/include -// RUN: %clang_cc1 -triple x86_64-apple-darwin \ -// RUN: -fmodules -fno-implicit-modules -fbuiltin-headers-in-system-modules \ -// RUN: -emit-obj -fmodule-name=test \ -// RUN: -x c %t/test.c -o %t/test.o \ -// RUN: -Werror=incompatible-pointer-types \ -// RUN: -fmodule-file=%t/DeclareVarargs.pcm -include-pch %t/prefix.pch.gch \ -// RUN: -I %t/include - -//--- include/declare-varargs.h -#ifndef DECLARE_VARARGS_H -#define DECLARE_VARARGS_H - -#include <stdarg.h> - -int vprintf(const char *format, va_list args); - -// 1. initializeBuiltins 'acos' causes its deserialization and deserialization -// of 'implementation_of_builtin'. Because this is done before Sema initialization, -// 'implementation_of_builtin' DeclID is added to PreloadedDeclIDs. -#undef acos -#define acos(__x) implementation_of_builtin(__x) - -// 2. Because of 'static' the function isn't added to EagerlyDeserializedDecls -// and not deserialized in `ASTReader::StartTranslationUnit` before `ASTReader::InitializeSema`. -// 3. Because of '__overloadable__' attribute the function requires name mangling during deserialization. -// And the name mangling requires '__builtin_va_list' decl. -// Because the function is added to PreloadedDeclIDs, the deserialization happens in `ASTReader::InitializeSema`. -static int __attribute__((__overloadable__)) implementation_of_builtin(int x) { - return x; -} - -#endif // DECLARE_VARARGS_H - -//--- include/module.modulemap -module DeclareVarargs { - header "declare-varargs.h" - export * -} - -//--- resource_dir/stdarg.h -#ifndef STDARG_H -#define STDARG_H - -typedef __builtin_va_list va_list; -#define va_start(ap, param) __builtin_va_start(ap, param) -#define va_end(ap) __builtin_va_end(ap) - -#endif // STDARG_H - -//--- resource_dir/module.modulemap -module _Builtin_stdarg { - header "stdarg.h" - export * -} - -//--- prefix.pch -#include <declare-varargs.h> - -//--- test.c -#include <declare-varargs.h> - -void test(const char *format, ...) { - va_list argParams; - va_start(argParams, format); - vprintf(format, argParams); - va_end(argParams); -} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits