[phc-internals] [phc commit] r1124 - in trunk/src: ast_to_hir
process_ir
codesite-noreply at google.com
codesite-noreply at google.com
Tue Apr 1 12:37:20 IST 2008
Author: paul.biggar
Date: Tue Apr 1 04:35:12 2008
New Revision: 1124
Modified:
trunk/src/ast_to_hir/Tidy_print.cpp
trunk/src/process_ir/General.cpp
trunk/src/process_ir/General.h
Log:
Add lower_ast (..., List<AST::Statement*>).
Note: I hope to make this as redundant as possible later.
This changes the API to use String* instead of char*, so fix these uses.
Modified: trunk/src/ast_to_hir/Tidy_print.cpp
==============================================================================
--- trunk/src/ast_to_hir/Tidy_print.cpp (original)
+++ trunk/src/ast_to_hir/Tidy_print.cpp Tue Apr 1 04:35:12 2008
@@ -41,7 +41,7 @@
if (not unused)
t2 = fresh_var ("TSp");
- out->push_back_all (lower_ast ("tidyp",
+ out->push_back_all (lower_ast (s("tidyp"),
new Eval_expr (
new Assignment(t2, false,
new Method_invocation(
Modified: trunk/src/process_ir/General.cpp
==============================================================================
--- trunk/src/process_ir/General.cpp (original)
+++ trunk/src/process_ir/General.cpp Tue Apr 1 04:35:12 2008
@@ -12,27 +12,31 @@
extern Pass_manager* pm;
-List<HIR::Statement*>* lower_hir (const char* name, HIR::Statement* in)
+List<HIR::Statement*>* lower_hir (String* name, HIR::Statement* in)
{
HIR::PHP_script* script = new HIR::PHP_script (
new List<HIR::Statement*> (in));
- assert (pm->has_pass_named (new String (name)));
+ assert (pm->has_pass_named (name));
- IR* new_script = pm->run_from_until (new String ("hir"), new String
(name), script);
+ IR* new_script = pm->run_from_until (s("hir"), name, script);
// TODO the typing is here is quite poor
return dynamic_cast<HIR::PHP_script*>(new_script)->statements;
}
-List<AST::Statement*>* lower_ast (const char* name, AST::Statement* in)
+List<AST::Statement*>* lower_ast (String* name, AST::Statement* in)
{
- AST::PHP_script* script = new AST::PHP_script (
- new List<AST::Statement*> (in));
+ return lower_ast (name, new List<AST::Statement*> (in));
+}
+
+List<AST::Statement*>* lower_ast (String* name, List<AST::Statement*>* in)
+{
+ AST::PHP_script* script = new AST::PHP_script (in);
- assert (pm->has_pass_named (new String (name)));
+ assert (pm->has_pass_named (name));
- IR* new_script = pm->run_from_until (new String ("ast"), new String
(name), script);
+ IR* new_script = pm->run_from_until (s("ast"), name, script);
// TODO the typing is here is quite poor
return dynamic_cast<AST::PHP_script*>(new_script)->statements;
Modified: trunk/src/process_ir/General.h
==============================================================================
--- trunk/src/process_ir/General.h (original)
+++ trunk/src/process_ir/General.h Tue Apr 1 04:35:12 2008
@@ -20,10 +20,11 @@
/* Lower IN by running all the passes between "hir" and NAME on it. */
-List<HIR::Statement*>* lower_hir (const char* name, HIR::Statement* in);
+List<HIR::Statement*>* lower_hir (String* name, HIR::Statement* in);
/* Lower IN by running all the passes between "ast" and NAME on it. */
-List<AST::Statement*>* lower_ast (const char* name, AST::Statement* in);
+List<AST::Statement*>* lower_ast (String* name, AST::Statement* in);
+List<AST::Statement*>* lower_ast (String* name, List<AST::Statement*>* in);
/* Parse CODE into a list of HIR statements, using NODE as the source for
More information about the phc-internals
mailing list