[clang] [clang][bytecode][NFC] Enfore internal linkage (PR #213208)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 30 22:56:55 PDT 2026
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/213208
For a struct and a function.
>From 116b0e27933e5134a876bcf852b786964aa48264 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Fri, 31 Jul 2026 07:55:48 +0200
Subject: [PATCH] [clang][bytecode][NFC] Enfore internal linkage
---
clang/lib/AST/ByteCode/Interp.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 23bdc5ea28c03..68ee5a8eb00a6 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -2061,6 +2061,7 @@ static bool getDynamicDecl(InterpState &S, CodePtr OpPC, PtrView TypePtr,
return DynamicDecl != nullptr;
}
+namespace {
struct DynamicCastResult {
UnsignedOrNone Offset = std::nullopt;
bool Ambiguous = false;
@@ -2085,6 +2086,7 @@ struct DynamicCastResult {
}
}
};
+} // namespace
// Walk UP the type hierarchy, starting at the decl of R to find Needle.
static DynamicCastResult findRecordBase(const ASTContext &Ctx, const Record *R,
@@ -3220,7 +3222,7 @@ bool CastFloatingIntegralAPS(InterpState &S, CodePtr OpPC, uint32_t BitWidth,
}
// FIXME: Would be nice to generate this instead of hardcoding it here.
-constexpr bool OpReturns(Opcode Op) {
+static constexpr bool OpReturns(Opcode Op) {
return Op == OP_RetVoid || Op == OP_RetValue || Op == OP_NoRet ||
Op == OP_RetSint8 || Op == OP_RetUint8 || Op == OP_RetSint16 ||
Op == OP_RetUint16 || Op == OP_RetSint32 || Op == OP_RetUint32 ||
More information about the cfe-commits
mailing list