Author: Timm Baeder
Date: 2025-07-11T15:47:32+02:00
New Revision: 38b9c660a7a3b8947b23acc344521d770c340e48

URL: 
https://github.com/llvm/llvm-project/commit/38b9c660a7a3b8947b23acc344521d770c340e48
DIFF: 
https://github.com/llvm/llvm-project/commit/38b9c660a7a3b8947b23acc344521d770c340e48.diff

LOG: [clang][bytecode] Remove needless global check (#148163)

Remove the call to D->hasGlobalStorage(), since we never reach this
point for local variables.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Interp.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Interp.cpp 
b/clang/lib/AST/ByteCode/Interp.cpp
index 18b84fa48fb1d..457de2bed37d6 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


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to