[clang] [ASTContext] Add a break to nested switch in `encodeTypeForFunctionPointerAuth` (PR #99763)

Brandon Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 10:41:29 PDT 2024


https://github.com/4vtomat updated https://github.com/llvm/llvm-project/pull/99763

>From 97dff508a361bbab478735eb4bf186d698649acf Mon Sep 17 00:00:00 2001
From: Brandon Wu <brandon.wu at sifive.com>
Date: Sat, 20 Jul 2024 07:27:53 -0700
Subject: [PATCH] [ASTContext] Add a default case to nested switch in
 `encodeTypeForFunctionPointerAuth`

This prevent the warning from compiler.
---
 clang/lib/AST/ASTContext.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 90bcbea072e39..87225b4702bd6 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3285,6 +3285,8 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext &Ctx,
   case Type::Builtin: {
     const auto *BTy = T->getAs<BuiltinType>();
     switch (BTy->getKind()) {
+    default:
+      llvm_unreachable("not yet implemented");
 #define SIGNED_TYPE(Id, SingletonId)                                           \
   case BuiltinType::Id:                                                        \
     OS << "i";                                                                 \



More information about the cfe-commits mailing list