Patchwork [MELT,minor] add a primitive read_strv

login
register
mail settings
Submitter Pierre Vittet
Date Aug. 30, 2011, 8:05 a.m.
Message ID <4E5C99C7.4030304@pvittet.com>
Download mbox | patch
Permalink /patch/112191/
State New
Headers show

Comments

Pierre Vittet - Aug. 30, 2011, 8:05 a.m.
Hello,

this is a ping for
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01503.html. I thought this
was integrated into MELT but it does not look to be in the current trunk.

It just add a primitive read_strv allowing to use meltgc_read_from_val
to get a list of s-expression from a boxed C string of a strbuf.

Pierre Vittet

2011-07-18  Pierre Vittet  <piervit@pvittet.com>

	* melt/warmelt-base.melt (read_strv): New primitive.

Patch

Index: gcc/melt/warmelt-base.melt
===================================================================
--- gcc/melt/warmelt-base.melt	(revision 176434)
+++ gcc/melt/warmelt-base.melt	(working copy)
@@ -272,6 +272,11 @@  number $NUM opaque location number $LOC.}#
   :doc #{Read from file named by the $FILNAM string balue a list of MELT s-expressions.}#
   #{(meltgc_read_file (melt_string_str((melt_ptr_t)($filnam)), (char*)0))}#)
 
+(defprimitive read_strv (strv) :value
+  :doc #{Return the list of sexpr contained in $STRV. $STRV can be a boxed
+  string or a strbuf value.}#
+  #{(meltgc_read_from_val ($strv, NULL))}#
+)
 
 ;; to signal an error in a  source with some additional string value
 (defprimitive error_strv (loc :cstring cmsg :value strv) :void
@@ -2441,6 +2446,7 @@  polyhedron values.}#
  pair_set_head 
  ppstrbuf_mixbigint
  read_file
+ read_strv
  register_pass_execution_hook
  register_pragma_handler
  register_pre_genericize_hook