Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
7f70b60f
Commit
7f70b60f
authored
Aug 17, 2015
by
Damien George
Browse files
py: Remove unused compile scope flags, and irrelevant flag compute code.
parent
2a6660ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/compile.c
View file @
7f70b60f
...
...
@@ -3301,18 +3301,6 @@ STATIC void scope_compute_things(scope_t *scope) {
scope
->
num_locals
+=
num_free
;
}
}
// compute scope_flags
int
num_free
=
0
;
for
(
int
i
=
0
;
i
<
scope
->
id_info_len
;
i
++
)
{
id_info_t
*
id
=
&
scope
->
id_info
[
i
];
if
(
id
->
kind
==
ID_INFO_KIND_CELL
||
id
->
kind
==
ID_INFO_KIND_FREE
)
{
num_free
+=
1
;
}
}
if
(
num_free
==
0
)
{
scope
->
scope_flags
|=
MP_SCOPE_FLAG_NOFREE
;
}
}
mp_obj_t
mp_compile
(
mp_parse_node_t
pn
,
qstr
source_file
,
uint
emit_opt
,
bool
is_repl
)
{
...
...
py/runtime0.h
View file @
7f70b60f
...
...
@@ -26,20 +26,10 @@
#ifndef __MICROPY_INCLUDED_PY_RUNTIME0_H__
#define __MICROPY_INCLUDED_PY_RUNTIME0_H__
// taken from python source, Include/code.h
// These must fit in 8 bits; see scope.h
#define MP_SCOPE_FLAG_OPTIMISED 0x01
#define MP_SCOPE_FLAG_NEWLOCALS 0x02
#define MP_SCOPE_FLAG_VARARGS 0x04
#define MP_SCOPE_FLAG_VARKEYWORDS 0x08
#define MP_SCOPE_FLAG_NESTED 0x10
#define MP_SCOPE_FLAG_GENERATOR 0x20
/* The MP_SCOPE_FLAG_NOFREE flag is set if there are no free or cell variables.
This information is redundant, but it allows a single flag test
to determine whether there is any extra work to be done when the
call frame is setup.
*/
#define MP_SCOPE_FLAG_NOFREE 0x40
#define MP_SCOPE_FLAG_VARARGS (0x01)
#define MP_SCOPE_FLAG_VARKEYWORDS (0x02)
#define MP_SCOPE_FLAG_GENERATOR (0x04)
// types for native (viper) function signature
#define MP_NATIVE_TYPE_OBJ (0x00)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment