FAUST compiler  0.9.9.6b8
Typedefs | Functions
shlysis.hh File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "list.hh"
Include dependency graph for shlysis.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef bool(* barrier )(const Tree &t)
 

Functions

Tree shprkey (Tree t)
 Create a specific property key for the sharing count of subtrees of t. More...
 
int shcount (Tree key, Tree t)
 Return the value of sharing count or 0. More...
 

Typedef Documentation

typedef bool(* barrier)(const Tree &t)

Definition at line 58 of file shlysis.hh.

Function Documentation

int shcount ( Tree  key,
Tree  t 
)

Return the value of sharing count or 0.

Definition at line 81 of file shlysis.cpp.

References Node::getInt(), getProperty(), and CTree::node().

Referenced by annotate().

82 {
83  Tree c;
84  if (getProperty(t, key, c)) {
85  return c->node().getInt();
86  } else {
87  return 0;
88  }
89 }
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
const Node & node() const
return the content of the tree
Definition: tree.hh:143
int getInt() const
Definition: node.hh:104
bool getProperty(Tree t, Tree key, Tree &val)
Definition: list.cpp:423

Here is the call graph for this function:

Here is the caller graph for this function:

Tree shprkey ( Tree  t)

Create a specific property key for the sharing count of subtrees of t.

Definition at line 69 of file shlysis.cpp.

References name(), tree(), and unique().

Referenced by ScalarCompiler::sharingAnalysis(), DocCompiler::sharingAnalysis(), and shlysis().

70 {
71  char name[256];
72  snprintf(name, 256, "SHARED IN %p : ", (CTree*)t);
73  return tree(unique(name));
74 }
Symbol * unique(const char *str)
Returns a new unique symbol of name strxxx.
Definition: symbol.hh:97
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
const char * name(Symbol *sym)
Returns the name of a symbol.
Definition: symbol.hh:98
Tree tree(const Node &n)
Definition: tree.hh:186

Here is the call graph for this function:

Here is the caller graph for this function: