[clang] e09107a - [Sema] Introduce BuiltinAttr, per-declaration builtin-ness
Author: Raul Tambre Date: 2020-09-17T19:28:57+03:00 New Revision: e09107ab80dced55414fa458cf78e6cdfe90da6e URL: https://github.com/llvm/llvm-project/commit/e09107ab80dced55414fa458cf78e6cdfe90da6e DIFF: https://github.com/llvm/llvm-project/commit/e09107ab80dced55414fa458cf78e6cdfe90da6e.diff LOG: [Sema] Introduce BuiltinAttr, per-declaration builtin-ness Instead of relying on whether a certain identifier is a builtin, introduce BuiltinAttr to specify a declaration as having builtin semantics. This fixes incompatible redeclarations of builtins, as reverting the identifier as being builtin due to one incompatible redeclaration would have broken rest of the builtin calls. Mostly-compatible redeclarations of builtins also no longer have builtin semantics. They don't call the builtin nor inherit their attributes. A long-standing FIXME regarding builtins inside a namespace enclosed in extern "C" not being recognized is also addressed. Due to the more correct handling attributes for builtin functions are added in more places, resulting in more useful warnings. Tests are updated to reflect that. Intrinsics without an inline definition in intrin.h had `inline` and `static` removed as they had no effect and caused them to no longer be recognized as builtins otherwise. A pthread_create() related test is XFAIL-ed, as it relied on it being recognized as a builtin based on its name. The builtin declaration syntax is too restrictive and doesn't allow custom structs, function pointers, etc. It seems to be the only case and fixing this would require reworking the current builtin syntax, so this seems acceptable. Fixes PR45410. Reviewed By: rsmith, yutsumi Differential Revision: https://reviews.llvm.org/D77491 Added: clang/test/CodeGen/builtin-redeclaration.c Modified: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/Builtins.def clang/include/clang/Basic/IdentifierTable.h clang/include/clang/Sema/Sema.h clang/lib/AST/Decl.cpp clang/lib/Headers/intrin.h clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaLookup.cpp clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTWriter.cpp clang/test/AST/ast-dump-attr.cpp clang/test/CodeGen/callback_pthread_create.c clang/test/CodeGenCXX/builtins.cpp clang/test/Sema/implicit-builtin-decl.c clang/test/Sema/warn-fortify-source.c clang/test/SemaCXX/cxx11-compat.cpp clang/test/SemaCXX/warn-unused-local-typedef.cpp Removed: diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 628649a6998d..c2073e68be2c 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -3526,3 +3526,11 @@ def ReleaseHandle : InheritableParamAttr { let Subjects = SubjectList<[ParmVar]>; let Documentation = [ReleaseHandleDocs]; } + +def Builtin : InheritableAttr { + let Spellings = []; + let Args = [UnsignedArgument<"ID">]; + let Subjects = SubjectList<[Function]>; + let SemaHandler = 0; + let Documentation = [Undocumented]; +} diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def index fb5b7ec22d07..efefe62c4a2c 100644 --- a/clang/include/clang/Basic/Builtins.def +++ b/clang/include/clang/Basic/Builtins.def @@ -1020,6 +1020,7 @@ LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h", ALL_GNU_LANGUAGES) LIBBUILTIN(_exit, "vi", "fr","unistd.h", ALL_GNU_LANGUAGES) LIBBUILTIN(vfork, "p","fj","unistd.h", ALL_LANGUAGES) // POSIX pthread.h +// FIXME: Should specify argument types. LIBBUILTIN(pthread_create, "", "fC<2,3>", "pthread.h", ALL_GNU_LANGUAGES) // POSIX setjmp.h diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h index fc554a35e721..204a0f0cc0a5 100644 --- a/clang/include/clang/Basic/IdentifierTable.h +++ b/clang/include/clang/Basic/IdentifierTable.h @@ -225,18 +225,6 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo { } void setObjCKeywordID(tok::ObjCKeywordKind ID) { ObjCOrBuiltinID = ID; } - /// True if setNotBuiltin() was called. - bool hasRevertedBuiltin() const { -return ObjCOrBuiltinID == tok::NUM_OBJC_KEYWORDS; - } - - /// Revert the identifier to a non-builtin identifier. We do this if - /// the name of a known builtin library function is used to declare that - /// function, but an unexpected type is specified. - void revertBuiltin() { -setBuiltinID(0); - } - /// Return a value indicating whether this is a builtin function. /// /// 0 is not-built-in. 1+ are specific builtin functions. diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 89771046f977..670bd8983265 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -4109,6 +4109,8 @@ class Sema final {
[clang] a1aa330 - [Sema] Handle objc_super special lookup when checking builtin compatibility
Author: Raul Tambre Date: 2020-09-18T20:51:55+03:00 New Revision: a1aa330b202f97ecd243ea9ef0c7ac00a80ea653 URL: https://github.com/llvm/llvm-project/commit/a1aa330b202f97ecd243ea9ef0c7ac00a80ea653 DIFF: https://github.com/llvm/llvm-project/commit/a1aa330b202f97ecd243ea9ef0c7ac00a80ea653.diff LOG: [Sema] Handle objc_super special lookup when checking builtin compatibility objc_super is special and needs LookupPredefedObjCSuperType() called before performing builtin type comparisons. This fixes an error when compiling macOS headers. A test is added. Differential Revision: https://reviews.llvm.org/D87917 Added: clang/test/SemaObjCXX/builtin-objcsuper.mm Modified: clang/lib/Sema/SemaDecl.cpp Removed: diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 20fb5a4d27e7..81d377cebb32 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -9671,6 +9671,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); } else { ASTContext::GetBuiltinTypeError Error; +LookupPredefedObjCSuperType(*this, S, NewFD->getIdentifier()); QualType BuiltinType = Context.GetBuiltinType(BuiltinID, Error); if (!Error && !BuiltinType.isNull() && diff --git a/clang/test/SemaObjCXX/builtin-objcsuper.mm b/clang/test/SemaObjCXX/builtin-objcsuper.mm new file mode 100644 index ..a6baf3c5165a --- /dev/null +++ b/clang/test/SemaObjCXX/builtin-objcsuper.mm @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -verify %s +// expected-no-diagnostics + +// objc_super has special lookup rules for compatibility with macOS headers, so +// the following should compile. +struct objc_super {}; +extern "C" id objc_msgSendSuper(struct objc_super *super, SEL op, ...); +extern "C" void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] f91f28c - [Sema] Split special builtin type lookups into a separate function
Author: Raul Tambre Date: 2020-09-21T19:12:29+03:00 New Revision: f91f28c350df6815d37c521e8f3dc0641a3ca467 URL: https://github.com/llvm/llvm-project/commit/f91f28c350df6815d37c521e8f3dc0641a3ca467 DIFF: https://github.com/llvm/llvm-project/commit/f91f28c350df6815d37c521e8f3dc0641a3ca467.diff LOG: [Sema] Split special builtin type lookups into a separate function In case further such cases appear in the future we've got a generic function to add them to. Additionally changed the ObjC special case to check the language and the identifier builtin ID instead of the name. Addresses the cleanup suggestion from D87917. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D87983 Added: Modified: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaLookup.cpp Removed: diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 12943f2bd5bd..5ca1634d57f9 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -3813,6 +3813,7 @@ class Sema final { RedeclarationKind Redecl = NotForRedeclaration); bool LookupBuiltin(LookupResult &R); + void LookupNecessaryTypesForBuiltin(Scope *S, unsigned ID); bool LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation = false); bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 81d377cebb32..2d09138a8b43 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2035,24 +2035,6 @@ Scope *Sema::getNonFieldDeclScope(Scope *S) { return S; } -/// Looks up the declaration of "struct objc_super" and -/// saves it for later use in building builtin declaration of -/// objc_msgSendSuper and objc_msgSendSuper_stret. If no such -/// pre-existing declaration exists no action takes place. -static void LookupPredefedObjCSuperType(Sema &ThisSema, Scope *S, -IdentifierInfo *II) { - if (!II->isStr("objc_msgSendSuper")) -return; - ASTContext &Context = ThisSema.Context; - - LookupResult Result(ThisSema, &Context.Idents.get("objc_super"), - SourceLocation(), Sema::LookupTagName); - ThisSema.LookupName(Result, S); - if (Result.getResultKind() == LookupResult::Found) -if (const TagDecl *TD = Result.getAsSingle()) - Context.setObjCSuperType(Context.getTagDeclType(TD)); -} - static StringRef getHeaderName(Builtin::Context &BuiltinInfo, unsigned ID, ASTContext::GetBuiltinTypeError Error) { switch (Error) { @@ -2113,7 +2095,7 @@ FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S, bool ForRedeclaration, SourceLocation Loc) { - LookupPredefedObjCSuperType(*this, S, II); + LookupNecessaryTypesForBuiltin(S, ID); ASTContext::GetBuiltinTypeError Error; QualType R = Context.GetBuiltinType(ID, Error); @@ -9671,7 +9653,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); } else { ASTContext::GetBuiltinTypeError Error; -LookupPredefedObjCSuperType(*this, S, NewFD->getIdentifier()); +LookupNecessaryTypesForBuiltin(S, BuiltinID); QualType BuiltinType = Context.GetBuiltinType(BuiltinID, Error); if (!Error && !BuiltinType.isNull() && @@ -10880,7 +10862,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, // declaration against the expected type for the builtin. if (unsigned BuiltinID = NewFD->getBuiltinID()) { ASTContext::GetBuiltinTypeError Error; - LookupPredefedObjCSuperType(*this, S, NewFD->getIdentifier()); + LookupNecessaryTypesForBuiltin(S, BuiltinID); QualType T = Context.GetBuiltinType(BuiltinID, Error); // If the type of the builtin diff ers only in its exception // specification, that's OK. diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 7da938cb8c38..cf3ae7ae5d05 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -907,6 +907,24 @@ bool Sema::LookupBuiltin(LookupResult &R) { return false; } +/// Looks up the declaration of "struct objc_super" and +/// saves it for later use in building builtin declaration of +/// objc_msgSendSuper and objc_msgSendSuper_stret. +static void LookupPredefedObjCSuperType(Sema &Sema, Scope *S) { + ASTContext &Context = Sema.Context; + LookupResult Result(Sema, &Context.Idents.get("objc_super"), SourceLocation(), + Sem
[libunwind] 45344cf - [CMake][compiler-rt][libunwind] Compile assembly files as ASM not C, unify workarounds
Author: Raul Tambre Date: 2020-08-27T15:40:15+03:00 New Revision: 45344cf7ac5b848f77825ffa37b0cb3b69b9b07b URL: https://github.com/llvm/llvm-project/commit/45344cf7ac5b848f77825ffa37b0cb3b69b9b07b DIFF: https://github.com/llvm/llvm-project/commit/45344cf7ac5b848f77825ffa37b0cb3b69b9b07b.diff LOG: [CMake][compiler-rt][libunwind] Compile assembly files as ASM not C, unify workarounds It isn't very wise to pass an assembly file to the compiler and tell it to compile as a C file and hope that the compiler recognizes it as assembly instead. Simply don't mark the file as C and CMake will recognize the rest. This was attempted earlier in https://reviews.llvm.org/D85706, but reverted due to architecture issues on Apple. Subsequent digging revealed a similar change was done earlier for libunwind in https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09. Afterwards workarounds were added for MinGW and Apple: * https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09 * https://reviews.llvm.org/rGd4ded05ba851304b26a437896bc3962ef56f62cb The workarounds in libunwind and compiler-rt are unified and comments added pointing to each other. The workaround is updated to only be used for MinGW for CMake versions before 3.17, which fixed the issue (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287). Additionally fixed Clang not being passed as the assembly compiler for compiler-rt runtime build. Example error: [525/634] Building C object lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o FAILED: lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o /opt/tooling/drive/host/bin/clang --target=aarch64-linux-gnu -I/opt/tooling/drive/llvm/compiler-rt/lib/tsan/.. -isystem /opt/tooling/drive/toolchain/opt/drive/toolchain/include -x c -Wall -Wno-unused-parameter -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fPIE -fno-rtti -Wframe-larger-than=530 -Wglobal-constructors --sysroot=. -MD -MT lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -MF lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o.d -o lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -c /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S:29:1: error: expected identifier or '(' .section .text ^ 1 error generated. Differential Revision: https://reviews.llvm.org/D86308 Added: Modified: clang/runtime/CMakeLists.txt compiler-rt/cmake/Modules/AddCompilerRT.cmake libunwind/src/CMakeLists.txt Removed: diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt index e20cc26f60af..61bbbf8faedd 100644 --- a/clang/runtime/CMakeLists.txt +++ b/clang/runtime/CMakeLists.txt @@ -75,6 +75,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/) CMAKE_ARGS ${CLANG_COMPILER_RT_CMAKE_ARGS} -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++ + -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DLLVM_CONFIG_PATH=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-config diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index efb660818270..f2f0b5ecde59 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -109,11 +109,11 @@ endfunction() function(add_asm_sources output) set(${output} ${ARGN} PARENT_SCOPE) - # Xcode will try to compile asm files as C ('clang -x c'), and that will fail. - if (${CMAKE_GENERATOR} STREQUAL "Xcode") -enable_language(ASM) - else() -# Pass ASM file directly to the C++ compiler. + # CMake doesn't pass the correct architecture for Apple prior to CMake 3.19. https://gitlab.kitware.com/cmake/cmake/-/issues/20771 + # MinGW didn't work correctly with assembly prior to CMake 3.17. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287 and https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09 + # Workaround these two issues by compiling as C. + # Same workaround used in libunwind. Also update there if changed here. + if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR (MINGW AND CMAKE_VERSION VERSION_LESS 3.17)) set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C) endif() endfunction() diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt index 928bc5992471..094
[clang] 45344cf - [CMake][compiler-rt][libunwind] Compile assembly files as ASM not C, unify workarounds
Author: Raul Tambre Date: 2020-08-27T15:40:15+03:00 New Revision: 45344cf7ac5b848f77825ffa37b0cb3b69b9b07b URL: https://github.com/llvm/llvm-project/commit/45344cf7ac5b848f77825ffa37b0cb3b69b9b07b DIFF: https://github.com/llvm/llvm-project/commit/45344cf7ac5b848f77825ffa37b0cb3b69b9b07b.diff LOG: [CMake][compiler-rt][libunwind] Compile assembly files as ASM not C, unify workarounds It isn't very wise to pass an assembly file to the compiler and tell it to compile as a C file and hope that the compiler recognizes it as assembly instead. Simply don't mark the file as C and CMake will recognize the rest. This was attempted earlier in https://reviews.llvm.org/D85706, but reverted due to architecture issues on Apple. Subsequent digging revealed a similar change was done earlier for libunwind in https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09. Afterwards workarounds were added for MinGW and Apple: * https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09 * https://reviews.llvm.org/rGd4ded05ba851304b26a437896bc3962ef56f62cb The workarounds in libunwind and compiler-rt are unified and comments added pointing to each other. The workaround is updated to only be used for MinGW for CMake versions before 3.17, which fixed the issue (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287). Additionally fixed Clang not being passed as the assembly compiler for compiler-rt runtime build. Example error: [525/634] Building C object lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o FAILED: lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o /opt/tooling/drive/host/bin/clang --target=aarch64-linux-gnu -I/opt/tooling/drive/llvm/compiler-rt/lib/tsan/.. -isystem /opt/tooling/drive/toolchain/opt/drive/toolchain/include -x c -Wall -Wno-unused-parameter -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fPIE -fno-rtti -Wframe-larger-than=530 -Wglobal-constructors --sysroot=. -MD -MT lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -MF lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o.d -o lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -c /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S:29:1: error: expected identifier or '(' .section .text ^ 1 error generated. Differential Revision: https://reviews.llvm.org/D86308 Added: Modified: clang/runtime/CMakeLists.txt compiler-rt/cmake/Modules/AddCompilerRT.cmake libunwind/src/CMakeLists.txt Removed: diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt index e20cc26f60af..61bbbf8faedd 100644 --- a/clang/runtime/CMakeLists.txt +++ b/clang/runtime/CMakeLists.txt @@ -75,6 +75,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/) CMAKE_ARGS ${CLANG_COMPILER_RT_CMAKE_ARGS} -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++ + -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DLLVM_CONFIG_PATH=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-config diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index efb660818270..f2f0b5ecde59 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -109,11 +109,11 @@ endfunction() function(add_asm_sources output) set(${output} ${ARGN} PARENT_SCOPE) - # Xcode will try to compile asm files as C ('clang -x c'), and that will fail. - if (${CMAKE_GENERATOR} STREQUAL "Xcode") -enable_language(ASM) - else() -# Pass ASM file directly to the C++ compiler. + # CMake doesn't pass the correct architecture for Apple prior to CMake 3.19. https://gitlab.kitware.com/cmake/cmake/-/issues/20771 + # MinGW didn't work correctly with assembly prior to CMake 3.17. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287 and https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09 + # Workaround these two issues by compiling as C. + # Same workaround used in libunwind. Also update there if changed here. + if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR (MINGW AND CMAKE_VERSION VERSION_LESS 3.17)) set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C) endif() endfunction() diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt index 928bc5992471..094
[clang] b5aef90 - [Clang] Fix instantiation of OpaqueValueExprs (Bug #45964)
Author: Jason Rice Date: 2021-11-06T10:06:38+02:00 New Revision: b5aef90d4656c5188759d03e2c5c3dc3d8bb398b URL: https://github.com/llvm/llvm-project/commit/b5aef90d4656c5188759d03e2c5c3dc3d8bb398b DIFF: https://github.com/llvm/llvm-project/commit/b5aef90d4656c5188759d03e2c5c3dc3d8bb398b.diff LOG: [Clang] Fix instantiation of OpaqueValueExprs (Bug #45964) The structured bindings decomposition of a non-dependent array in a dependent context (a template) were, upon instantiation, creating nested OpaqueValueExprs that would trigger assertions in CodeGen. Additionally the OpaqueValuesExpr's contained SourceExpr is being emitted in CodeGen, but there was no code for its transform in template instantiation. This would trigger other assertions such as when emitting a DeclRefExpr that refers to a VarDecl that is not marked as ODR-used. This is all based on cursory deduction, but with the way the code flows from SemaTemplateInstantiate back to SemaInit, it is apparent that the nesting of OpaqueValueExpr is unintentional. This commit fixes https://bugs.llvm.org/show_bug.cgi?id=45964 and possible other issues involving OpaqueValueExprs in template instantiations might be resolved. Reviewed By: aaron.ballman, rjmccall Differential Revision: https://reviews.llvm.org/D108482 Added: clang/test/CodeGenCXX/pr45964-decomp-transform.cpp Modified: clang/lib/Sema/TreeTransform.h Removed: diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index ad61a6782976e..3f0f21b2e6e73 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -3853,8 +3853,10 @@ ExprResult TreeTransform::TransformInitializer(Expr *Init, if (auto *FE = dyn_cast(Init)) Init = FE->getSubExpr(); - if (auto *AIL = dyn_cast(Init)) -Init = AIL->getCommonExpr(); + if (auto *AIL = dyn_cast(Init)) { +OpaqueValueExpr *OVE = AIL->getCommonExpr(); +Init = OVE->getSourceExpr(); + } if (MaterializeTemporaryExpr *MTE = dyn_cast(Init)) Init = MTE->getSubExpr(); diff --git a/clang/test/CodeGenCXX/pr45964-decomp-transform.cpp b/clang/test/CodeGenCXX/pr45964-decomp-transform.cpp new file mode 100644 index 0..927624ca6e370 --- /dev/null +++ b/clang/test/CodeGenCXX/pr45964-decomp-transform.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s + +int a[1]; +// CHECK: @a = global [1 x i32] zeroinitializer +template +void test_transform() { + auto [b] = a; +} +void (*d)(){test_transform<0>}; +// CHECK-LABEL: define {{.*}} @_Z14test_transformILi0EEvv +// CHECK: [[ENTRY:.*]]: +// CHECK-NEXT: [[ARR:%.*]] = alloca [1 x i32] +// CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [1 x i32], [1 x i32]* [[ARR]], i64 0, i64 0 +// CHECK-NEXT: br label %[[BODY:.*]] +// CHECK-EMPTY: +// CHECK-NEXT: [[BODY]]: +// CHECK-NEXT: [[CUR:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[NEXT:%.*]], %[[BODY]] ] +// CHECK-NEXT: [[DEST:%.*]] = getelementptr inbounds i32, i32* [[BEGIN]], i64 [[CUR]] +// CHECK-NEXT: [[SRC:%.*]] = getelementptr inbounds [1 x i32], [1 x i32]* @a, i64 0, i64 [[CUR]] +// CHECK-NEXT: [[X:%.*]] = load i32, i32* [[SRC]] +// CHECK-NEXT: store i32 [[X]], i32* [[DEST]] +// CHECK-NEXT: [[NEXT]] = add nuw i64 [[CUR]], 1 +// CHECK-NEXT: [[EQ:%.*]] = icmp eq i64 [[NEXT]], 1 +// CHECK-NEXT: br i1 [[EQ]], label %[[FIN:.*]], label %[[BODY]] +// CHECK-EMPTY: +// CHECK-NEXT: [[FIN]]: +// CHECK-NEXT: ret void ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Some adjustments for reloctable linking on OpenBSD (PR #67254)
tambry wrote: reloctable→relocatable Just a fly-by, but IMO the commit message ought to describe the change – "some changes" doesn't give much insight. https://github.com/llvm/llvm-project/pull/67254 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type (PR #87793)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/87793 Enums are passed as their underlying integral type so they're ABI compatible if the size matches. Useful with C APIs that pass user-controlled values to callbacks that can be made type safe by using enumerations (e.g. GStreamer). Discovered internally in some code after 999d4f840777bf8de26d45947192aa0728edc0fb. >From 21a85320f485e4c11e734c24c6c1d74f8bea215d Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Fri, 5 Apr 2024 18:05:09 +0300 Subject: [PATCH] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type Enums are passed as their underlying integral type so they're ABI compatible if the size matches. Useful with C APIs that pass user-controlled values to callbacks that can be made type safe by using enumerations (e.g. GStreamer). --- clang/lib/Sema/SemaCast.cpp | 7 --- clang/test/Sema/warn-cast-function-type-strict.c | 4 clang/test/Sema/warn-cast-function-type.c | 4 clang/test/SemaCXX/warn-cast-function-type-strict.cpp | 4 clang/test/SemaCXX/warn-cast-function-type.cpp| 4 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 9d85568d97b2d2..b93724a85999be 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -1083,9 +1083,10 @@ static bool argTypeIsABIEquivalent(QualType SrcType, QualType DestType, return true; // Allow integral type mismatch if their size are equal. - if (SrcType->isIntegralType(Context) && DestType->isIntegralType(Context)) -if (Context.getTypeInfoInChars(SrcType).Width == -Context.getTypeInfoInChars(DestType).Width) + if ((SrcType->isIntegralType(Context) || SrcType->isEnumeralType()) && + (DestType->isIntegralType(Context) || DestType->isEnumeralType())) +if (Context.getTypeSizeInChars(SrcType) == +Context.getTypeSizeInChars(DestType)) return true; return Context.hasSameUnqualifiedType(SrcType, DestType); diff --git a/clang/test/Sema/warn-cast-function-type-strict.c b/clang/test/Sema/warn-cast-function-type-strict.c index b0a70cf324b711..b21365cdd30a57 100644 --- a/clang/test/Sema/warn-cast-function-type-strict.c +++ b/clang/test/Sema/warn-cast-function-type-strict.c @@ -29,8 +29,12 @@ f8 *h; f9 *i; f10 *j; +enum E : long; +int efunc(enum E); + void foo(void) { a = (f1 *)x; + a = (f1 *)efunc; // strict-warning {{cast from 'int (*)(enum E)' to 'f1 *' (aka 'int (*)(long)') converts to incompatible function type}} b = (f2 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} */ c = (f3 *)x; /* strict-warning {{cast from 'int (*)(long)' to 'f3 *' (aka 'int (*)()') converts to incompatible function type}} */ d = (f4 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f4 *' (aka 'void (*)()') converts to incompatible function type}} */ diff --git a/clang/test/Sema/warn-cast-function-type.c b/clang/test/Sema/warn-cast-function-type.c index 09d169026b1c86..969a62043791f4 100644 --- a/clang/test/Sema/warn-cast-function-type.c +++ b/clang/test/Sema/warn-cast-function-type.c @@ -19,8 +19,12 @@ f5 *e; f6 *f; f7 *g; +enum E : long; +int efunc(enum E); + void foo(void) { a = (f1 *)x; + a = (f1 *)efunc; // enum is just type system sugar, still passed as a long. b = (f2 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} */ c = (f3 *)x; d = (f4 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f4 *' (aka 'void (*)()') converts to incompatible function type}} */ diff --git a/clang/test/SemaCXX/warn-cast-function-type-strict.cpp b/clang/test/SemaCXX/warn-cast-function-type-strict.cpp index 8887b3c4c5d535..c49b0ac4b26a23 100644 --- a/clang/test/SemaCXX/warn-cast-function-type-strict.cpp +++ b/clang/test/SemaCXX/warn-cast-function-type-strict.cpp @@ -29,8 +29,12 @@ struct S typedef void (S::*mf)(int); +enum E : long; +int efunc(E); + void foo() { a = (f1 *)x; + a = (f1 *)efunc; // strict-warning {{cast from 'int (*)(E)' to 'f1 *' (aka 'int (*)(long)') converts to incompatible function type}} b = (f2 *)x; // expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} b = reinterpret_cast(x); // expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} c = (f3 *)x; // strict-warning {{cast from 'int (*)(long)' to 'f3 *' (aka 'int (*)(...)') converts to incompatible function type}} diff --git a/clang/test/SemaCXX/warn-cast-function-type.cpp b/clang/test/SemaCXX/warn-cast-function-type.cpp index db2ee030fcbfc9..467fcd6abc2482 100644 --- a/clang/test/SemaCXX/warn-cast-function-type.cpp +++ b/cla
[clang] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type (PR #87793)
https://github.com/tambry updated https://github.com/llvm/llvm-project/pull/87793 >From 4bc51b03d29b602f75c0ab37f14c932b310871d5 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Fri, 5 Apr 2024 18:05:09 +0300 Subject: [PATCH] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type Enums are passed as their underlying integral type so they're ABI compatible if the size matches. Useful with C APIs that pass user-controlled values to callbacks that can be made type safe by using enumerations (e.g. GStreamer). --- clang/lib/Sema/SemaCast.cpp | 7 --- clang/test/Sema/warn-cast-function-type-strict.c | 9 + clang/test/Sema/warn-cast-function-type.c | 9 + clang/test/SemaCXX/warn-cast-function-type-strict.cpp | 9 + clang/test/SemaCXX/warn-cast-function-type.cpp| 9 + 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 7db6b1dfe923b4..f03dcf05411dfc 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -1093,9 +1093,10 @@ static bool argTypeIsABIEquivalent(QualType SrcType, QualType DestType, return true; // Allow integral type mismatch if their size are equal. - if (SrcType->isIntegralType(Context) && DestType->isIntegralType(Context)) -if (Context.getTypeInfoInChars(SrcType).Width == -Context.getTypeInfoInChars(DestType).Width) + if ((SrcType->isIntegralType(Context) || SrcType->isEnumeralType()) && + (DestType->isIntegralType(Context) || DestType->isEnumeralType())) +if (Context.getTypeSizeInChars(SrcType) == +Context.getTypeSizeInChars(DestType)) return true; return Context.hasSameUnqualifiedType(SrcType, DestType); diff --git a/clang/test/Sema/warn-cast-function-type-strict.c b/clang/test/Sema/warn-cast-function-type-strict.c index b0a70cf324b711..c43e0f2fcbc63d 100644 --- a/clang/test/Sema/warn-cast-function-type-strict.c +++ b/clang/test/Sema/warn-cast-function-type-strict.c @@ -29,8 +29,17 @@ f8 *h; f9 *i; f10 *j; +enum E : long; +int efunc(enum E); + +// Produce the underlying `long` type implicitly. +enum E2 { big = __LONG_MAX__ }; +int e2func(enum E2); + void foo(void) { a = (f1 *)x; + a = (f1 *)efunc; // strict-warning {{cast from 'int (*)(enum E)' to 'f1 *' (aka 'int (*)(long)') converts to incompatible function type}} + a = (f1 *)e2func; // strict-warning {{cast from 'int (*)(enum E2)' to 'f1 *' (aka 'int (*)(long)') converts to incompatible function type}} b = (f2 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} */ c = (f3 *)x; /* strict-warning {{cast from 'int (*)(long)' to 'f3 *' (aka 'int (*)()') converts to incompatible function type}} */ d = (f4 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f4 *' (aka 'void (*)()') converts to incompatible function type}} */ diff --git a/clang/test/Sema/warn-cast-function-type.c b/clang/test/Sema/warn-cast-function-type.c index 09d169026b1c86..d474dbf48b8971 100644 --- a/clang/test/Sema/warn-cast-function-type.c +++ b/clang/test/Sema/warn-cast-function-type.c @@ -19,8 +19,17 @@ f5 *e; f6 *f; f7 *g; +enum E : long; +int efunc(enum E); + +// Produce the underlying `long` type implicitly. +enum E2 { big = __LONG_MAX__ }; +int e2func(enum E2); + void foo(void) { a = (f1 *)x; + a = (f1 *)efunc; // enum is just type system sugar, still passed as a long. + a = (f1 *)e2func; // enum is just type system sugar, still passed as a long. b = (f2 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} */ c = (f3 *)x; d = (f4 *)x; /* expected-warning {{cast from 'int (*)(long)' to 'f4 *' (aka 'void (*)()') converts to incompatible function type}} */ diff --git a/clang/test/SemaCXX/warn-cast-function-type-strict.cpp b/clang/test/SemaCXX/warn-cast-function-type-strict.cpp index 8887b3c4c5d535..9203c1aae8c901 100644 --- a/clang/test/SemaCXX/warn-cast-function-type-strict.cpp +++ b/clang/test/SemaCXX/warn-cast-function-type-strict.cpp @@ -29,8 +29,17 @@ struct S typedef void (S::*mf)(int); +enum E : long; +int efunc(E); + +// Produce the underlying `long` type implicitly. +enum E2 { big = __LONG_MAX__ }; +int e2func(E2); + void foo() { a = (f1 *)x; + a = (f1 *)efunc; // strict-warning {{cast from 'int (*)(E)' to 'f1 *' (aka 'int (*)(long)') converts to incompatible function type}} + a = (f1 *)e2func; // strict-warning {{cast from 'int (*)(E2)' to 'f1 *' (aka 'int (*)(long)') converts to incompatible function type}} b = (f2 *)x; // expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} b = reinterpret_cast(x); // expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to
[clang] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type (PR #87793)
@@ -19,8 +19,12 @@ f5 *e; f6 *f; f7 *g; +enum E : long; tambry wrote: Good idea, done! https://github.com/llvm/llvm-project/pull/87793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type (PR #87793)
tambry wrote: I'm able to land myself. 🙂 Waiting for the CI to go green. https://github.com/llvm/llvm-project/pull/87793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a matching underlying type (PR #87793)
https://github.com/tambry closed https://github.com/llvm/llvm-project/pull/87793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] 480643a - [CMake] Remove dead code setting policies to NEW
Author: Raul Tambre Date: 2021-01-19T17:19:36+02:00 New Revision: 480643a95cd157e654f4f97e8231b18850e7d79a URL: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a DIFF: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a.diff LOG: [CMake] Remove dead code setting policies to NEW cmake_minimum_required(VERSION) calls cmake_policy(VERSION), which sets all policies up to VERSION to NEW. LLVM started requiring CMake 3.13 last year, so we can remove a bunch of code setting policies prior to 3.13 to NEW as it no longer has any effect. Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D94374 Added: Modified: clang/CMakeLists.txt compiler-rt/CMakeLists.txt flang/CMakeLists.txt libcxx/CMakeLists.txt libcxx/utils/ci/runtimes/CMakeLists.txt libcxxabi/CMakeLists.txt libunwind/CMakeLists.txt lldb/CMakeLists.txt llvm/CMakeLists.txt mlir/examples/standalone/CMakeLists.txt Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f1e5a39cfe05..9e74014134a0 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # If we are not building as a part of LLVM, build Clang as an # standalone project, using LLVM as an external library: if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 30302c2c1427..b44ad2c2118e 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -5,10 +5,6 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) project(CompilerRT C CXX ASM) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 07d34354bd81..79aa53830d5e 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -1,20 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) -# RPATH settings on macOS do not affect INSTALL_NAME. -if (POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -# Include file check macros honor CMAKE_REQUIRED_LIBRARIES. -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -# option() honors normal variables. -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON) option(FLANG_BUILD_NEW_DRIVER "Build the flang compiler driver" OFF) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index f4c7e9992f71..46a669500548 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -10,16 +10,7 @@ endif() #=== cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() -if(POLICY CMP0022) - cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang -endif() -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) # Add path for custom modules set(CMAKE_MODULE_PATH diff --git a/libcxx/utils/ci/runtimes/CMakeLists.txt b/libcxx/utils/ci/runtimes/CMakeLists.txt index 20980b530d4d..ab4182ae949e 100644 --- a/libcxx/utils/ci/runtimes/CMakeLists.txt +++ b/libcxx/utils/ci/runtimes/CMakeLists.txt @@ -1,20 +1,8 @@ cmake_minimum_required(VERSION 3.13.4) - -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -if(POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() - project(LLVM_RUNTIMES) +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) message(WARNING "Python3 not found, using python2 as a fallback") diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 146749f57b0a..c8ab9d7acb1d 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -10,10 +10,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() - # Add path for custom modules set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index e344263173b0..8ae32fbccf4e 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -8,10 +8,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -
[clang] 480643a - [CMake] Remove dead code setting policies to NEW
Author: Raul Tambre Date: 2021-01-19T17:19:36+02:00 New Revision: 480643a95cd157e654f4f97e8231b18850e7d79a URL: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a DIFF: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a.diff LOG: [CMake] Remove dead code setting policies to NEW cmake_minimum_required(VERSION) calls cmake_policy(VERSION), which sets all policies up to VERSION to NEW. LLVM started requiring CMake 3.13 last year, so we can remove a bunch of code setting policies prior to 3.13 to NEW as it no longer has any effect. Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D94374 Added: Modified: clang/CMakeLists.txt compiler-rt/CMakeLists.txt flang/CMakeLists.txt libcxx/CMakeLists.txt libcxx/utils/ci/runtimes/CMakeLists.txt libcxxabi/CMakeLists.txt libunwind/CMakeLists.txt lldb/CMakeLists.txt llvm/CMakeLists.txt mlir/examples/standalone/CMakeLists.txt Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f1e5a39cfe05..9e74014134a0 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # If we are not building as a part of LLVM, build Clang as an # standalone project, using LLVM as an external library: if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 30302c2c1427..b44ad2c2118e 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -5,10 +5,6 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) project(CompilerRT C CXX ASM) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 07d34354bd81..79aa53830d5e 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -1,20 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) -# RPATH settings on macOS do not affect INSTALL_NAME. -if (POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -# Include file check macros honor CMAKE_REQUIRED_LIBRARIES. -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -# option() honors normal variables. -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON) option(FLANG_BUILD_NEW_DRIVER "Build the flang compiler driver" OFF) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index f4c7e9992f71..46a669500548 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -10,16 +10,7 @@ endif() #=== cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() -if(POLICY CMP0022) - cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang -endif() -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) # Add path for custom modules set(CMAKE_MODULE_PATH diff --git a/libcxx/utils/ci/runtimes/CMakeLists.txt b/libcxx/utils/ci/runtimes/CMakeLists.txt index 20980b530d4d..ab4182ae949e 100644 --- a/libcxx/utils/ci/runtimes/CMakeLists.txt +++ b/libcxx/utils/ci/runtimes/CMakeLists.txt @@ -1,20 +1,8 @@ cmake_minimum_required(VERSION 3.13.4) - -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -if(POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() - project(LLVM_RUNTIMES) +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) message(WARNING "Python3 not found, using python2 as a fallback") diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 146749f57b0a..c8ab9d7acb1d 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -10,10 +10,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() - # Add path for custom modules set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index e344263173b0..8ae32fbccf4e 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -8,10 +8,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -
[clang] [clang] Alias iso9899:2024 to C23, update documentation (PR #138459)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/138459 None >From 4f4394ff468cb0b398df9e8dab7cf9d18b019c1a Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 4 May 2025 18:58:13 +0300 Subject: [PATCH] [clang] Alias iso9899:2024 to C23, update documentation --- clang/docs/CommandGuide/clang.rst | 9 + clang/docs/ReleaseNotes.rst | 1 + clang/include/clang/Basic/LangStandards.def | 7 +++ clang/test/Driver/unknown-std.c | 5 ++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst index 42aac7b25d93c..e3399d39bf00c 100644 --- a/clang/docs/CommandGuide/clang.rst +++ b/clang/docs/CommandGuide/clang.rst @@ -146,6 +146,15 @@ Language Selection and Mode Options ISO C 2017 with GNU extensions + | ``c23`` + | ``iso9899:2024`` + + ISO C 2023 + + | ``gnu23`` + + ISO C 2023 with GNU extensions + The default C language standard is ``gnu17``, except on PS4, where it is ``gnu99``. diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 918ff952bb2c3..52ef686841c04 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -241,6 +241,7 @@ C2y Feature Support C23 Feature Support ^^^ +- Clang now accepts ``-std=iso9899:2024`` as an alias for C23. - Added ``__builtin_c23_va_start()`` for compatibility with GCC and to enable better diagnostic behavior for the ``va_start()`` macro in C23 and later. This also updates the definition of ``va_start()`` in to use diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def index 982a79873adb5..49cd9881829d4 100644 --- a/clang/include/clang/Basic/LangStandards.def +++ b/clang/include/clang/Basic/LangStandards.def @@ -89,15 +89,14 @@ LANGSTANDARD_ALIAS(gnu17, "gnu18") // C23 modes LANGSTANDARD(c23, "c23", - C, "Working Draft for ISO C23", + C, "ISO C 2023", LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat) +LANGSTANDARD_ALIAS(c23, "iso9899:2024") LANGSTANDARD_ALIAS_DEPR(c23, "c2x") LANGSTANDARD(gnu23, "gnu23", - C, "Working Draft for ISO C23 with GNU extensions", + C, "ISO C 2023 with GNU extensions", LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat) LANGSTANDARD_ALIAS_DEPR(gnu23, "gnu2x") -// FIXME: Add the alias for iso9899:202* once we know the year ISO publishes -// the document (expected to be 2024). // C2y modes LANGSTANDARD(c2y, "c2y", diff --git a/clang/test/Driver/unknown-std.c b/clang/test/Driver/unknown-std.c index 332d587ddd4a1..539b04f69b9ae 100644 --- a/clang/test/Driver/unknown-std.c +++ b/clang/test/Driver/unknown-std.c @@ -15,11 +15,10 @@ // CHECK-NEXT: note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard // CHECK-NEXT: note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard // CHECK-NEXT: note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard -// CHECK-NEXT: note: use 'c23' for 'Working Draft for ISO C23' standard -// CHECK-NEXT: note: use 'gnu23' for 'Working Draft for ISO C23 with GNU extensions' standard +// CHECK-NEXT: note: use 'c23' or 'iso9899:2024' for 'ISO C 2023' standard +// CHECK-NEXT: note: use 'gnu23' for 'ISO C 2023 with GNU extensions' standard // CHECK-NEXT: note: use 'c2y' for 'Working Draft for ISO C2y' standard // CHECK-NEXT: note: use 'gnu2y' for 'Working Draft for ISO C2y with GNU extensions' standard // Make sure that no other output is present. // CHECK-NOT: {{^.+$}} - ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/138460 Futureproofs our single Debian-specific special case for roughly the next 6 years. See: https://lists.debian.org/debian-devel-announce/2025/01/msg4.html >From 71ed6486e8036682bda9b0f6bd88277c7d927cb2 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 4 May 2025 19:03:50 +0300 Subject: [PATCH] [clang] Add support for Debian 14 Forky and Debian 15 Duke Futureproofs our single Debian-specific special case for roughly the next 6 years. See: https://lists.debian.org/debian-devel-announce/2025/01/msg4.html --- clang/include/clang/Driver/Distro.h | 4 +++- clang/lib/Driver/Distro.cpp | 6 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h index 9f27c2baaeb47..5c25592e68ade 100644 --- a/clang/include/clang/Driver/Distro.h +++ b/clang/include/clang/Driver/Distro.h @@ -39,6 +39,8 @@ class Distro { DebianBullseye, DebianBookworm, DebianTrixie, +DebianForky, +DebianDuke, Exherbo, RHEL5, RHEL6, @@ -129,7 +131,7 @@ class Distro { bool IsOpenSUSE() const { return DistroVal == OpenSUSE; } bool IsDebian() const { -return DistroVal >= DebianLenny && DistroVal <= DebianTrixie; +return DistroVal >= DebianLenny && DistroVal <= DebianDuke; } bool IsUbuntu() const { diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp index 82c627819d9fc..90e5a390be7eb 100644 --- a/clang/lib/Driver/Distro.cpp +++ b/clang/lib/Driver/Distro.cpp @@ -161,6 +161,10 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { return Distro::DebianBookworm; case 13: return Distro::DebianTrixie; + case 14: +return Distro::DebianForky; + case 15: +return Distro::DebianDuke; default: return Distro::UnknownDistro; } @@ -174,6 +178,8 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { .Case("bullseye/sid", Distro::DebianBullseye) .Case("bookworm/sid", Distro::DebianBookworm) .Case("trixie/sid", Distro::DebianTrixie) +.Case("forky/sid", Distro::DebianForky) +.Case("duke/sid", Distro::DebianDuke) .Default(Distro::UnknownDistro); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
tambry wrote: I have commit access but I'll wait for CI so everything's per the book. :slightly_smiling_face: https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][doc] Document C2y flags (PR #138521)
https://github.com/tambry closed https://github.com/llvm/llvm-project/pull/138521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
tambry wrote: /cherry-pick 58e6883c8b6e571d6bd774645ee2b6348cfed6ba https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
tambry wrote: Seems like the cherry-pick only works if the branch of the PR still exists. :thinking: https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
https://github.com/tambry milestoned https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
tambry wrote: /cherry-pick 58e6883c8b6e571d6bd774645ee2b6348cfed6ba https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
https://github.com/tambry closed https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Alias iso9899:2024 to C23, update documentation (PR #138459)
https://github.com/tambry closed https://github.com/llvm/llvm-project/pull/138459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Alias iso9899:2024 to C23, update documentation (PR #138459)
tambry wrote: @AaronBallman Hmm, should we also document `-std=c2y` and `-std=gnu2y` https://github.com/llvm/llvm-project/pull/138459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][doc] Document C2y flags (PR #138521)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/138521 As discussed at https://github.com/llvm/llvm-project/pull/138459#issuecomment-2850716184 >From cff2d2a856b3e36935969612a4e4338e9d4a2fe3 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Mon, 5 May 2025 15:36:39 +0300 Subject: [PATCH] [clang][doc] Document C2y flags --- clang/docs/CommandGuide/clang.rst | 8 clang/include/clang/Basic/LangStandards.def | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst index e3399d39bf00c..1b8776c5e9ad2 100644 --- a/clang/docs/CommandGuide/clang.rst +++ b/clang/docs/CommandGuide/clang.rst @@ -155,6 +155,14 @@ Language Selection and Mode Options ISO C 2023 with GNU extensions + | ``c2y`` + + ISO C 202y + + | ``gnu2y`` + + ISO C 202y with GNU extensions + The default C language standard is ``gnu17``, except on PS4, where it is ``gnu99``. diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def index 49cd9881829d4..244692ab4296a 100644 --- a/clang/include/clang/Basic/LangStandards.def +++ b/clang/include/clang/Basic/LangStandards.def @@ -105,7 +105,7 @@ LANGSTANDARD(c2y, "c2y", LANGSTANDARD(gnu2y, "gnu2y", C, "Working Draft for ISO C2y with GNU extensions", LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | GNUMode | HexFloat) - +// TODO: Add the iso9899:202y alias once ISO publishes the standard. // C++ modes LANGSTANDARD(cxx98, "c++98", ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libc] [libcxx] [libcxxabi] [libunwind] [cmake] Normalize TARGET_SUBDIR paths (PR #138524)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/138524 Some code paths normalize ".." and thus don't create the directory. But some execute in a shell thus requiring the directory to exist to be able to take the parent directory. Normalize all the `TARGET_SUBDIR` variables to avoid this issue. >From 1a2e201b3f4ae437852a83d926799617004b2728 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Mon, 5 May 2025 15:40:25 +0300 Subject: [PATCH] [cmake] Normalize TARGET_SUBDIR paths Some code paths normalize ".." and thus don't create the directory. But some execute in a shell thus requiring the directory to exist to be able to take the parent directory. Normalize all the `TARGET_SUBDIR` variables to avoid this issue. --- libc/CMakeLists.txt | 1 + libcxx/CMakeLists.txt| 1 + libcxxabi/CMakeLists.txt | 1 + libunwind/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index b264dcb4974c7..f21fc2fba7305 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -220,6 +220,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) if(LIBC_LIBDIR_SUBDIR) string(APPEND LIBC_TARGET_SUBDIR /${LIBC_LIBDIR_SUBDIR}) endif() + cmake_path(NORMAL_PATH LIBC_TARGET_SUBDIR) endif() if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND (LIBC_ENABLE_USE_BY_CLANG OR LIBC_TARGET_OS_IS_GPU)) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index ebaa6e9fd0e97..da059ffef8034 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -419,6 +419,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) if(LIBCXX_LIBDIR_SUBDIR) string(APPEND LIBCXX_TARGET_SUBDIR /${LIBCXX_LIBDIR_SUBDIR}) endif() + cmake_path(NORMAL_PATH LIBCXX_TARGET_SUBDIR) set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBCXX_TARGET_SUBDIR}) set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") set(LIBCXX_GENERATED_MODULE_DIR "${LLVM_BINARY_DIR}/modules/c++/v1") diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 6dcfc51e55321..3e2f80b818450 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -187,6 +187,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) if(LIBCXXABI_LIBDIR_SUBDIR) string(APPEND LIBCXXABI_TARGET_SUBDIR /${LIBCXXABI_LIBDIR_SUBDIR}) endif() + cmake_path(NORMAL_PATH LIBCXXABI_TARGET_SUBDIR) set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR}) set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBCXXABI_TARGET_SUBDIR}) set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LIBCXXABI_TARGET_SUBDIR} CACHE STRING diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index 3c8499fd33464..e27f3c2e2fc17 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -145,6 +145,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) if(LIBUNWIND_LIBDIR_SUBDIR) string(APPEND LIBUNWIND_TARGET_SUBDIR /${LIBUNWIND_LIBDIR_SUBDIR}) endif() + cmake_path(NORMAL_PATH LIBUNWIND_TARGET_SUBDIR) set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBUNWIND_TARGET_SUBDIR}) set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LIBUNWIND_TARGET_SUBDIR} CACHE STRING "Path where built libunwind libraries should be installed.") ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
tambry wrote: @anutosh491 Yep, precisely. That's what I did here. https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add support for Debian 14 Forky and Debian 15 Duke (PR #138460)
tambry wrote: Someone probably ought to open an issue for that issue. https://github.com/llvm/llvm-project/pull/138460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits