Skip to content

Commit f01c6c8

Browse files
author
git apple-llvm automerger
committed
Merge commit 'e7b3b94cf500' from llvm.org/release/17.x into stable/20230725
2 parents 5f82bf9 + e7b3b94 commit f01c6c8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,8 @@ Bug Fixes in This Version
723723
virtual member functions even if the target required a greater function
724724
alignment and/or did not have function pointers which point to function entry
725725
points (i.e., uses function descriptor objects instead).
726+
- Fixes a ``clang-17`` regression where ``LLVM_UNREACHABLE_OPTIMIZE=OFF``
727+
cannot be used with ``Release`` mode builds. (`#68237 <https://github.com/llvm/llvm-project/issues/68237>`_).
726728

727729
Bug Fixes to Compiler Builtins
728730
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,23 +2664,28 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS,
26642664
OS << ", ";
26652665
emitFormInitializer(OS, Spellings[0], "0");
26662666
} else {
2667-
OS << ", (\n";
2667+
OS << ", [&]() {\n";
2668+
OS << " switch (S) {\n";
26682669
std::set<std::string> Uniques;
26692670
unsigned Idx = 0;
26702671
for (auto I = Spellings.begin(), E = Spellings.end(); I != E;
26712672
++I, ++Idx) {
26722673
const FlattenedSpelling &S = *I;
26732674
const auto &Name = SemanticToSyntacticMap[Idx];
26742675
if (Uniques.insert(Name).second) {
2675-
OS << " S == " << Name << " ? AttributeCommonInfo::Form";
2676+
OS << " case " << Name << ":\n";
2677+
OS << " return AttributeCommonInfo::Form";
26762678
emitFormInitializer(OS, S, Name);
2677-
OS << " :\n";
2679+
OS << ";\n";
26782680
}
26792681
}
2680-
OS << " (llvm_unreachable(\"Unknown attribute spelling!\"), "
2681-
<< " AttributeCommonInfo::Form";
2682+
OS << " default:\n";
2683+
OS << " llvm_unreachable(\"Unknown attribute spelling!\");\n"
2684+
<< " return AttributeCommonInfo::Form";
26822685
emitFormInitializer(OS, Spellings[0], "0");
2683-
OS << "))";
2686+
OS << ";\n"
2687+
<< " }\n"
2688+
<< " }()";
26842689
}
26852690

26862691
OS << ");\n";

0 commit comments

Comments
 (0)