gh-115480: Type and constant propagation for int BINARY_OPs (GH-115478)

This commit is contained in:
Ken Jin 2024-02-15 14:02:18 +08:00 committed by GitHub
parent ed23839dc5
commit 4ebf8fbdab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 126 additions and 16 deletions

View file

@ -341,6 +341,18 @@ sym_new_const(_Py_UOpsAbstractInterpContext *ctx, PyObject *const_val)
return temp;
}
static inline bool
is_const(_Py_UOpsSymType *sym)
{
return sym->const_val != NULL;
}
static inline PyObject *
get_const(_Py_UOpsSymType *sym)
{
return sym->const_val;
}
static _Py_UOpsSymType*
sym_new_null(_Py_UOpsAbstractInterpContext *ctx)
{