summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-28 12:18:21 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-28 12:18:21 +0000
commit8422fa6afbb619fc66678c664bfaf834691527fc (patch)
tree9585fb84283ad1a5a67b3a71d277b51f2d9581b4 /gcc
parent1a1e2ea9976294348e7388297acec937a1f6690f (diff)
downloadgcc-8422fa6afbb619fc66678c664bfaf834691527fc.tar.gz
2012-10-28 Basile Starynkevitch <basile@starynkevitch.net>
* melt/xtramelt-ana-tree.melt (tree_addr_expr): Can be used to build trees. (tree_va_arg_expr): New cmatcher. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@192893 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.MELT6
-rw-r--r--gcc/melt/xtramelt-ana-tree.melt24
2 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog.MELT b/gcc/ChangeLog.MELT
index 6bb8944dd26..a6d13917d15 100644
--- a/gcc/ChangeLog.MELT
+++ b/gcc/ChangeLog.MELT
@@ -1,4 +1,10 @@
+2012-10-28 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * melt/xtramelt-ana-tree.melt (tree_addr_expr): Can be used to
+ build trees.
+ (tree_va_arg_expr): New cmatcher.
+
2012-10-24 Basile Starynkevitch <basile@starynkevitch.net>
* melt/xtramelt-probe.melt (scanprobe_exec): Use output_tree, not
diff --git a/gcc/melt/xtramelt-ana-tree.melt b/gcc/melt/xtramelt-ana-tree.melt
index 106b7ea40c6..7d9c5ea1f01 100644
--- a/gcc/melt/xtramelt-ana-tree.melt
+++ b/gcc/melt/xtramelt-ana-tree.melt
@@ -1064,9 +1064,28 @@ current :tree and :gimple. Stop walking if the closure gives null.}#
#{ /* tree_addr_expr $TREEAE !*/
$TYPE = TREE_TYPE ($tr);
$EXPR = TREE_OPERAND ($tr, 0);
- }#)
+ }#
+ #{ /* tree_addr_expr: */ (($TYPE != NULL && $EXPR != NULL)
+ ? build_fold_addr_expr_with_type((tree)$EXPR, (tree)$TYPE)
+ : (tree)NULL)
+ }#
+)
+;;;;;;;;;;;;;;;;
+(defcmatcher tree_va_arg_expr
+ (:tree tr)
+ (:tree trva trtype)
+ treeva
+ :doc #{$TREE_VA_ARG_EPXR is used for @code{va_arg} in variadic functions.}#
+ #{ /* tree_va_arg_expr $TREEVA ?*/
+ (($TR) && TREE_CODE ($TR) == VA_ARG_EXPR)
+ }#
+ #{ /* tree_va_arg_expr $TREEVA !*/
+ $TRVA = TREE_OPERAND ($TR, 0);
+ $TRTYPE = TREE_TYPE ($TR);
+ }#
+)
;;;;;;;;
(defcmatcher tree_record_type
(:tree tr)
@@ -1704,7 +1723,8 @@ pointer type node.}#
tree_uid
tree_unsigned_char_type_node
tree_unsigned_type_node
- tree_useless_type_conversion_p
+ tree_useless_type_conversion_p
+ tree_va_arg_expr
tree_var_decl
tree_var_decl_named
tree_var_decl_of_name