aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal/pycore_instruction_sequence.h
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2025-04-28 06:10:28 -0700
committerGitHub <noreply@github.com>2025-04-28 06:10:28 -0700
commit922049b613d155ade4c4a8f83452767bea003a9f (patch)
treec466659499780de432b0d77a803d3adfbe739174 /Include/internal/pycore_instruction_sequence.h
parent5bf0f3666e272798789ff900b1071760c73b46fd (diff)
downloadcpython-922049b613d155ade4c4a8f83452767bea003a9f.tar.gz
cpython-922049b613d155ade4c4a8f83452767bea003a9f.zip
gh-130907: Treat all module-level annotations as conditional (#131550)
Diffstat (limited to 'Include/internal/pycore_instruction_sequence.h')
-rw-r--r--Include/internal/pycore_instruction_sequence.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/internal/pycore_instruction_sequence.h b/Include/internal/pycore_instruction_sequence.h
index 099f2fd1240..b5c92773537 100644
--- a/Include/internal/pycore_instruction_sequence.h
+++ b/Include/internal/pycore_instruction_sequence.h
@@ -45,6 +45,9 @@ typedef struct instruction_sequence {
/* PyList of instruction sequences of nested functions */
PyObject *s_nested;
+
+ /* Code for creating annotations, spliced into the main sequence later */
+ struct instruction_sequence *s_annotations_code;
} _PyInstructionSequence;
typedef struct {
@@ -66,6 +69,8 @@ _PyJumpTargetLabel _PyInstructionSequence_NewLabel(_PyInstructionSequence *seq);
int _PyInstructionSequence_ApplyLabelMap(_PyInstructionSequence *seq);
int _PyInstructionSequence_InsertInstruction(_PyInstructionSequence *seq, int pos,
int opcode, int oparg, _Py_SourceLocation loc);
+int _PyInstructionSequence_SetAnnotationsCode(_PyInstructionSequence *seq,
+ _PyInstructionSequence *annotations);
int _PyInstructionSequence_AddNested(_PyInstructionSequence *seq, _PyInstructionSequence *nested);
void PyInstructionSequence_Fini(_PyInstructionSequence *seq);