aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorArvind Mukund <MasterAwesome@users.noreply.github.com>2023-10-05 12:01:56 -0700
committerGitHub <noreply@github.com>2023-10-05 15:01:56 -0400
commitbffbe9a9cf3a287648d81675a99ff9a808fab990 (patch)
treec3ec1e1e30d0b4b075f880e8abe5e8e6e3f498be /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parenta50e63b38b931d945f97eac882278068221eca17 (diff)
downloadllvm-bffbe9a9cf3a287648d81675a99ff9a808fab990.zip
llvm-bffbe9a9cf3a287648d81675a99ff9a808fab990.tar.gz
llvm-bffbe9a9cf3a287648d81675a99ff9a808fab990.tar.bz2
[clang] Correct behavior of `LLVM_UNREACHABLE_OPTIMIZE=OFF` for `Release` 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 https://github.com/llvm/llvm-project/issues/68237
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
0 files changed, 0 insertions, 0 deletions