aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Interp.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-04-16 09:00:52 +0200
committerGitHub <noreply@github.com>2025-04-16 09:00:52 +0200
commit05eafd9f2b14f2e8d2d95f46465c5cc53aafbc56 (patch)
tree6ea23b52dc5aacfb296dd56955174b08bf92092a /clang/lib/AST/ByteCode/Interp.cpp
parenta56f966417bc53051fa39e3db6fcc95f9abf0b5c (diff)
downloadllvm-05eafd9f2b14f2e8d2d95f46465c5cc53aafbc56.zip
llvm-05eafd9f2b14f2e8d2d95f46465c5cc53aafbc56.tar.gz
llvm-05eafd9f2b14f2e8d2d95f46465c5cc53aafbc56.tar.bz2
[clang][bytecode] Explicitly mark constexpr-unknown variables as such (#135806)
Instead of trying to figure out what's constexpr-unknown later on.
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Interp.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 3e1f36d..4625154 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -299,15 +299,14 @@ void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC,
TYPE_SWITCH(Ty, S.Stk.discard<T>());
}
-// FIXME: Instead of using this fairly expensive test, we should
-// just mark constexpr-unknown values when creating them.
bool isConstexprUnknown(const Pointer &P) {
if (!P.isBlockPointer())
return false;
+
if (P.isDummy())
- return false;
- const VarDecl *VD = P.block()->getDescriptor()->asVarDecl();
- return VD && VD->hasLocalStorage() && !isa<ParmVarDecl>(VD);
+ return isa_and_nonnull<ParmVarDecl>(P.getDeclDesc()->asValueDecl());
+
+ return P.getDeclDesc()->IsConstexprUnknown;
}
bool CheckBCPResult(InterpState &S, const Pointer &Ptr) {