Added llvmgcc version to allow tests to be xfailed by frontend version.
[llvm-complete.git] / utils / Burg / pattern.c
blob2ff72e7c410a869870ebf3e3effea3bb246d70d7
1 char rcsid_pattern[] = "$Id$";
3 #include <stdio.h>
4 #include "b.h"
6 Pattern
7 newPattern(op) Operator op;
9 Pattern p;
11 p = (Pattern) zalloc(sizeof(struct pattern));
12 p->op = op;
13 return p;
16 void
17 dumpPattern(p) Pattern p;
19 int i;
21 if (!p) {
22 printf("[no-pattern]");
23 return;
26 if (p->op) {
27 printf("%s", p->op->name);
28 if (p->op->arity > 0) {
29 printf("(");
30 for (i = 0; i < p->op->arity; i++) {
31 printf("%s ", p->children[i]->name);
33 printf(")");
35 } else {
36 printf("%s", p->children[0]->name);