-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Cannot build obj.clangAST
when LLVM_UNREACHABLE_OPTIMIZATIONS
are turned off
#68237
Cannot build obj.clangAST
when LLVM_UNREACHABLE_OPTIMIZATIONS
are turned off
#68237
Comments
I can contribute to this change, where can I read about the procedure abut these types of changes, do I contribute to |
…ase` builds (#68284) # Codegen ### Before ```c++ AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) { AttributeCommonInfo I(Range, NoSemaHandlerAttribute, ( S == GNU_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} : S == CXX11_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} : S == C23_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} : (llvm_unreachable("Unknown attribute spelling!"), AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}))); return CreateImplicit(Ctx, I); } ``` ### After ```c++ AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) { AttributeCommonInfo I(Range, NoSemaHandlerAttribute, [&]() { switch (S) { case GNU_aarch64_sve_pcs: return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; case CXX11_clang_aarch64_sve_pcs: return AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; case C23_clang_aarch64_sve_pcs: return AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; default: llvm_unreachable("Unknown attribute spelling!"); return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; } }()); return CreateImplicit(Ctx, I); } ``` Fixes #68237
/cherry-pick bffbe9a |
Failed to cherry-pick: bffbe9a https://github.com/llvm/llvm-project/actions/runs/6423348224 Please manually backport the fix and push it to your github fork. Once this is done, please add a comment like this:
|
/branch MasterAwesome/rust-llvm-project/llvm/release/17.x |
/pull-request llvm/llvm-project-release-prs#726 |
…ase` builds (#68284) ```c++ AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) { AttributeCommonInfo I(Range, NoSemaHandlerAttribute, ( S == GNU_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} : S == CXX11_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} : S == C23_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} : (llvm_unreachable("Unknown attribute spelling!"), AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}))); return CreateImplicit(Ctx, I); } ``` ```c++ AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) { AttributeCommonInfo I(Range, NoSemaHandlerAttribute, [&]() { switch (S) { case GNU_aarch64_sve_pcs: return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; case CXX11_clang_aarch64_sve_pcs: return AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; case C23_clang_aarch64_sve_pcs: return AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; default: llvm_unreachable("Unknown attribute spelling!"); return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/}; } }()); return CreateImplicit(Ctx, I); } ``` Fixes llvm/llvm-project#68237 Conflicts: clang/docs/ReleaseNotes.rst
I'm trying to build clang in
Release
mode withLLVM_UNREACHABLE_OPTIMIZATIONS
turned off; however, the fileAttrImpl.cpp
fails to compile. This happens inrelease/17.x
branch andmain
.cmake llvm \ -DLLVM_ENABLE_PROJECTS=clang \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_ASM_COMPILER=clang \ -DLLVM_UNREACHABLE_OPTIMIZE=OFF \ -B build cd build/ make obj.clangAST
This seems due to the fact that on
CMAKE_BUILD_TYPE=Release
+LLVM_UNREACHABLE_OPTIMIZE=OFF
leads tollvm-project/llvm/include/llvm/Support/ErrorHandling.h
Lines 151 to 154 in 6cbf6f5
AttrImpl.inc
) to not compile. All other variants work [(Release +LLVM_UNREACHABLE_OPTIMIZE=ON
), (Debug +LLVM_UNREACHABLE_OPTIMIZE=[ON|OFF]
)]This is bisected to
clang-tblgen
change b6d4d51#diff-58111c7c545672c3a67b1b31a37d4103b35d9c584a46c74b0be14cc37741491bR2642-R2646Tested with both host toolchains
clang 17.0.2
andgcc 13.2.0
For Rust specific issue: Rust defaults to
LLVM_UNREACHABLE_OPTIMIZE=OFF
for all LLVM builds and this causes a regression whenLLVM
is compiled in release mode. See rust-lang/rust#109373The text was updated successfully, but these errors were encountered: