diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-07-11 15:47:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-11 15:47:32 +0200 |
commit | 38b9c660a7a3b8947b23acc344521d770c340e48 (patch) | |
tree | c6a725d87654f8c30be3e8a93edc66227372251c /clang/lib/AST/ByteCode/Interp.cpp | |
parent | d11fd669598944b8f1204a7e42ae427fc4901ba9 (diff) | |
download | llvm-38b9c660a7a3b8947b23acc344521d770c340e48.zip llvm-38b9c660a7a3b8947b23acc344521d770c340e48.tar.gz llvm-38b9c660a7a3b8947b23acc344521d770c340e48.tar.bz2 |
[clang][bytecode] Remove needless global check (#148163)
Remove the call to D->hasGlobalStorage(), since we never reach this
point for local variables.
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Interp.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp index 18b84fa..457de2b 100644 --- a/clang/lib/AST/ByteCode/Interp.cpp +++ b/clang/lib/AST/ByteCode/Interp.cpp @@ -445,13 +445,7 @@ bool CheckConstant(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { assert(Desc); const auto *D = Desc->asVarDecl(); - if (!D || !D->hasGlobalStorage()) - return true; - - if (D == S.EvaluatingDecl) - return true; - - if (D->isConstexpr()) + if (!D || D == S.EvaluatingDecl || D->isConstexpr()) return true; // If we're evaluating the initializer for a constexpr variable in C23, we may |