[clang] [clang][bytecode][NFC] Move Remove unused CheckExtern prototype (PR #223146)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 12 06:17:47 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
And add an overload taking only a Block.
---
Full diff: https://github.com/llvm/llvm-project/pull/223146.diff
2 Files Affected:
- (modified) clang/lib/AST/ByteCode/Interp.cpp (+8-2)
- (modified) clang/lib/AST/ByteCode/Interp.h (-3)
``````````diff
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 160cc745c89b6..b0b8cfd7198ac 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -461,7 +461,7 @@ bool CheckActive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
return false;
}
-bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
+static bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
if (!Ptr.isExtern())
return true;
@@ -480,6 +480,12 @@ bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
return false;
}
+static bool CheckExtern(InterpState &S, CodePtr OpPC, const Block *B) {
+ if (!B->isExtern())
+ return true;
+ return CheckExtern(S, OpPC, Pointer(const_cast<Block *>(B)));
+}
+
bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
if (!Ptr.isUnknownSizeArray())
return true;
@@ -874,7 +880,7 @@ static bool CheckWeak(InterpState &S, CodePtr OpPC, const Block *B) {
bool CheckGlobalLoad(InterpState &S, CodePtr OpPC, const Block *B) {
const auto &Desc = B->getBlockDesc<GlobalInlineDescriptor>();
if (!B->isAccessible()) {
- if (!CheckExtern(S, OpPC, Pointer(const_cast<Block *>(B))))
+ if (!CheckExtern(S, OpPC, B))
return false;
if (!CheckDummy(S, OpPC, B, AK_Read))
return false;
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index a20a3f91dd267..7c71635561708 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -55,9 +55,6 @@ namespace interp {
using APSInt = llvm::APSInt;
using FixedPointSemantics = llvm::FixedPointSemantics;
-/// Checks if the variable has externally defined storage.
-bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
-
/// Checks if a pointer is null.
bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
CheckSubobjectKind CSK);
``````````
</details>
https://github.com/llvm/llvm-project/pull/223146
More information about the cfe-commits
mailing list