Skip to content

Commit 38b9c66

Browse files
authored
[clang][bytecode] Remove needless global check (#148163)
Remove the call to D->hasGlobalStorage(), since we never reach this point for local variables.
1 parent d11fd66 commit 38b9c66

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,7 @@ bool CheckConstant(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
445445
assert(Desc);
446446

447447
const auto *D = Desc->asVarDecl();
448-
if (!D || !D->hasGlobalStorage())
449-
return true;
450-
451-
if (D == S.EvaluatingDecl)
452-
return true;
453-
454-
if (D->isConstexpr())
448+
if (!D || D == S.EvaluatingDecl || D->isConstexpr())
455449
return true;
456450

457451
// If we're evaluating the initializer for a constexpr variable in C23, we may

0 commit comments

Comments
 (0)