From 2bbc16ac334f19ef8ddc3cb7dca24884af72f88c Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Thu, 23 May 2013 13:47:38 +0200 Subject: [PATCH] Fixed different uses of *volatile*, which indented wrong or placed it in the wrong place --- src/cmp/cmpblock.lsp | 2 +- src/cmp/cmpflet.lsp | 6 +++--- src/cmp/cmplam.lsp | 2 +- src/cmp/cmpmulti.lsp | 2 +- src/cmp/cmptop.lsp | 11 +++++++---- src/cmp/cmpvar.lsp | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/cmp/cmpblock.lsp b/src/cmp/cmpblock.lsp index 0eb1e9232..5f8ff85e0 100644 --- a/src/cmp/cmpblock.lsp +++ b/src/cmp/cmpblock.lsp @@ -58,7 +58,7 @@ (wt-nl "cl_object " blk-var ";")) (when (env-grows (blk-ref-ccb blk)) (let ((env-lvl *env-lvl*)) - (wt-nl *volatile* "cl_object env" (incf *env-lvl*) + (wt-nl "cl_object " *volatile* "env" (incf *env-lvl*) " = env" env-lvl ";"))) (bind "ECL_NEW_FRAME_ID(cl_env_copy)" blk-var) (wt-nl "if (ecl_frs_push(cl_env_copy," blk-var ")!=0) {") diff --git a/src/cmp/cmpflet.lsp b/src/cmp/cmpflet.lsp index a759f8211..3fe1dfee2 100644 --- a/src/cmp/cmpflet.lsp +++ b/src/cmp/cmpflet.lsp @@ -182,7 +182,7 @@ &aux (*env* *env*) (*inline-blocks* 0) - (*env-lvl* *env-lvl*) env-grows) + (*env-lvl* *env-lvl*)) (declare (ignore c1form)) ;; create location for each function which is returned, ;; either in lexical: @@ -199,13 +199,13 @@ (otherwise (maybe-open-inline-block) (bind (next-lcl) var) - (wt-nl *volatile* "cl_object " var ";"))) + (wt-nl "cl_object " *volatile* var ";"))) finally ;; if we have closed variables (when (env-grows env-grows) (maybe-open-inline-block) (let ((env-lvl *env-lvl*)) - (wt "volatile cl_object env" (incf *env-lvl*) " = env" env-lvl ";"))) + (wt "cl_object " *volatile* "env" (incf *env-lvl*) " = env" env-lvl ";"))) ;; bind closed locations because of possible circularities (loop for var in closed-vars do (bind nil var))) diff --git a/src/cmp/cmplam.lsp b/src/cmp/cmplam.lsp index c7637ae3a..91cf968c9 100644 --- a/src/cmp/cmplam.lsp +++ b/src/cmp/cmplam.lsp @@ -375,7 +375,7 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts." (labels ((wt-decl (var) (let ((lcl (next-lcl (var-name var)))) (wt-nl) - (wt *volatile* (rep-type-name (var-rep-type var)) " " lcl ";") + (wt (rep-type-name (var-rep-type var)) " " *volatile* lcl ";") lcl)) (do-decl (var) (when (local var) ; no LCL needed for SPECIAL or LEX diff --git a/src/cmp/cmpmulti.lsp b/src/cmp/cmpmulti.lsp index d10d96a01..aa2197dee 100644 --- a/src/cmp/cmpmulti.lsp +++ b/src/cmp/cmpmulti.lsp @@ -262,7 +262,7 @@ (when (useful-var-p var) (maybe-open-inline-block) (bind (next-lcl) var) - (wt-nl *volatile* (rep-type-name kind) " " var ";") + (wt-nl (rep-type-name kind) " " *volatile* var ";") (wt-comment (var-name var))) (unless env-grows (setq env-grows (var-ref-ccb var)))))) diff --git a/src/cmp/cmptop.lsp b/src/cmp/cmptop.lsp index 225996d6e..780ee47ba 100644 --- a/src/cmp/cmptop.lsp +++ b/src/cmp/cmptop.lsp @@ -105,7 +105,7 @@ (defun ctop-write (name h-pathname data-pathname &aux def top-output-string - (*volatile* " volatile ")) + (*volatile* "volatile ")) (setq *top-level-forms* (nreverse *top-level-forms*)) (wt-nl "#include \"" (brief-namestring h-pathname) "\"") @@ -266,8 +266,11 @@ (*compile-to-linking-call* nil) (*compile-file-truename* (and form (c1form-file form))) (*compile-file-position* (and form (c1form-file-position form)))) - (let ((body (with-output-to-string (*compiler-output1*) - (t2expr form)))) + ;; We save the C body of the statement, indented, just in case + ;; we need to add a {} section with the environment variables. + (let ((body (let ((*opened-c-braces* (1+ *opened-c-braces*))) + (with-output-to-string (*compiler-output1*) + (t2expr form))))) (if (or (plusp *max-lex*) (plusp *max-temp*) (plusp *max-env*) @@ -672,7 +675,7 @@ (wt-nl "const cl_env_ptr cl_env_copy = ecl_process_env();") (when (eq (fun-closure fun) 'CLOSURE) (wt-nl "cl_object " *volatile* "env0 = cl_env_copy->function->cclosure.env;")) - (wt-nl *volatile* "cl_object value0;") + (wt-nl "cl_object " *volatile* "value0;") (when (policy-check-stack-overflow) (wt-nl "ecl_cs_check(cl_env_copy,value0);")) (when (eq (fun-closure fun) 'CLOSURE) diff --git a/src/cmp/cmpvar.lsp b/src/cmp/cmpvar.lsp index 56b30164c..2c7453382 100644 --- a/src/cmp/cmpvar.lsp +++ b/src/cmp/cmpvar.lsp @@ -452,7 +452,7 @@ (rep-type-name (rep-type-name rep-type)) (temp (make-lcl-var :rep-type rep-type))) (wt-nl-open-brace) - (wt-nl *volatile* rep-type-name " " temp ";") + (wt-nl rep-type-name " " *volatile* temp ";") (let ((*destination* temp)) (c2expr* form)) (push (cons var temp) saves)) (let ((*destination* (make-temp-var)))