Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
abcl
abcl
Commits
2bf7079c
Commit
2bf7079c
authored
Aug 21, 2011
by
ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files
Factor out a function.
parent
42718e40
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/org/armedbear/lisp/compiler-pass1.lisp
View file @
2bf7079c
...
...
@@ -1173,6 +1173,35 @@ where each of the vars returned is a list with these elements:
"Dummy FUNCALL wrapper to force p1 not to optimize the call."
(
apply
fn
args
))
(
defun
p1-variable-reference
(
var
)
(
let
((
variable
(
find-visible-variable
var
)))
(
when
(
null
variable
)
(
unless
(
or
(
special-variable-p
var
)
(
memq
var
*undefined-variables*
))
(
compiler-style-warn
"Undefined variable ~S assumed special"
var
)
(
push
var
*undefined-variables*
))
(
setf
variable
(
make-variable
:name
var
:special-p
t
))
(
push
variable
*visible-variables*
))
(
let
((
ref
(
make-var-ref
variable
)))
(
unless
(
variable-special-p
variable
)
(
when
(
variable-ignore-p
variable
)
(
compiler-style-warn
"Variable ~S is read even though it was declared to be ignored."
(
variable-name
variable
)))
(
push
ref
(
variable-references
variable
))
(
incf
(
variable-reads
variable
))
(
cond
((
eq
(
variable-compiland
variable
)
*current-compiland*
)
(
dformat
t
"p1: read ~S~%"
var
))
(
t
(
dformat
t
"p1: non-local read ~S variable-compiland = ~S current compiland = ~S~%"
var
(
compiland-name
(
variable-compiland
variable
))
(
compiland-name
*current-compiland*
))
(
setf
(
variable-used-non-locally-p
variable
)
t
))))
ref
)))
(
defknown
p1
(
t
)
t
)
(
defun
p1
(
form
)
(
cond
...
...
@@ -1193,34 +1222,7 @@ where each of the vars returned is a list with these elements:
(
pathnamep
value
))))
(
setf
form
value
))
(
t
(
let
((
variable
(
find-visible-variable
form
)))
(
when
(
null
variable
)
(
unless
(
or
(
special-variable-p
form
)
(
memq
form
*undefined-variables*
))
(
compiler-style-warn
"Undefined variable ~S assumed special"
form
)
(
push
form
*undefined-variables*
))
(
setf
variable
(
make-variable
:name
form
:special-p
t
))
(
push
variable
*visible-variables*
))
(
let
((
ref
(
make-var-ref
variable
)))
(
unless
(
variable-special-p
variable
)
(
when
(
variable-ignore-p
variable
)
(
compiler-style-warn
"Variable ~S is read even though it was declared to be ignored."
(
variable-name
variable
)))
(
push
ref
(
variable-references
variable
))
(
incf
(
variable-reads
variable
))
(
cond
((
eq
(
variable-compiland
variable
)
*current-compiland*
)
(
dformat
t
"p1: read ~S~%"
form
))
(
t
(
dformat
t
"p1: non-local read ~S variable-compiland = ~S current compiland = ~S~%"
form
(
compiland-name
(
variable-compiland
variable
))
(
compiland-name
*current-compiland*
))
(
setf
(
variable-used-non-locally-p
variable
)
t
))))
(
setf
form
ref
)))
form
))))
(
p1-variable-reference
form
)))))
((
atom
form
)
form
)
(
t
...
...
Write
Preview
Markdown
is supported
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