Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
3d16844c
Commit
3d16844c
authored
Sep 14, 2000
by
Götz Lindenmaier
Browse files
*** empty log message ***
[r70]
parent
c133b932
Changes
15
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
3d16844c
...
...
@@ -32,7 +32,7 @@ clean:
realclean
:
for
i
in
$(SUBDIRS)
;
do
$(MAKE)
-C
$$
i realclean
;
done
rm
-f
libfirm.a core include/
*
.h
rm
-f
libfirm.a core include/
*
.h
TAGS
TAGFILES
=
$(
shell
find
.
-name
'*.c'
-o
-name
'*.h'
)
...
...
README
0 → 100644
View file @
3d16844c
This is a library implementing the intermediate representation
FIRM developed at IPD Goos, Uni Karlsruhe.
Call make lib to construct the library. This creates a file
libfirm.a and extracts all necessary header files to ./include.
To test the library goto ./testprograms and make and run the
test examples placed there:
make lib
cd testprograms
make
make run
For more documentation see /include/firm.h.
To generate FIRM code from a compiler frontend read the documentation
in ./include/ircons.h.
About Firm you can learn in UKA tech-report 1999-??.
ir/ir/Makefile
View file @
3d16844c
...
...
@@ -29,7 +29,7 @@ MEMBERS = $(DISTRIBMEMBERS)
CFILES
=
$(MEMBERS:.m=.c)
HFILES
=
$(MEMBERS:.m=.h)
HFILES
+=
irnode_t.h irgraph_t.h
HFILES
+=
irnode_t.h irgraph_t.h
ir_op_t.h
HFILES
+=
array.h common.h cookies.h debug.h entity.h gmp.h
\
host.h ident.h label.h misc.h obst.h pdeq.h pset.h
\
set.h tune.h tv.h type.h xprintf.h xp_help.h irnode2.h
...
...
ir/ir/irdump.c
View file @
3d16844c
...
...
@@ -14,7 +14,7 @@
# include "entity.h"
# include <stdlib.h>
# include "array.h"
# include "irop.h"
# include "irop
_t
.h"
# include "tv.h"
# include "type_or_entity.h"
# include "irgwalk.h"
...
...
ir/ir/irgwalk.h
View file @
3d16844c
...
...
@@ -6,6 +6,9 @@
** traverse an ir graph
** - execute the pre function before recursion
** - execute the post function after recursion
**
** Uses current_ir_graph (from irgraph.h)!!! Set it to the proper
** graph before starting the walker.
*/
...
...
ir/ir/irnode.c
View file @
3d16844c
...
...
@@ -116,7 +116,7 @@ ir_node_print (XP_PAR1, const xprintf_info *info ATTRIBUTE((unused)), XP_PARN)
return
printed
;
}
XPF1
(
"%I"
,
get_irn_op
name
(
np
));
XPF1
(
"%I"
,
get_irn_op
ident
(
np
));
switch
(
get_irn_opcode
(
np
))
{
/* node label */
case
iro_Const
:
...
...
@@ -247,8 +247,15 @@ get_irn_opcode (ir_node *node)
return
node
->
op
->
code
;
}
inline
ident
*
inline
const
char
*
get_irn_opname
(
ir_node
*
node
)
{
assert
(
node
);
return
id_to_str
(
node
->
op
->
name
);
}
inline
ident
*
get_irn_opident
(
ir_node
*
node
)
{
assert
(
node
);
return
node
->
op
->
name
;
...
...
@@ -691,11 +698,16 @@ get_Call_param_arr (ir_node *node) {
}
inline
int
get_Call_
arity
(
ir_node
*
node
)
{
get_Call_
n_params
(
ir_node
*
node
)
{
assert
(
node
->
op
==
op_Call
);
return
(
get_irn_arity
(
node
)
-
CALL_PARAM_OFFSET
);
}
inline
int
get_Call_arity
(
ir_node
*
node
)
{
return
get_Call_n_params
(
node
);
}
/* inline void
set_Call_arity (ir_node *node, ir_node *arity) {
assert (node->op == op_Call);
...
...
ir/ir/irnode.h
View file @
3d16844c
...
...
@@ -65,7 +65,8 @@ inline void set_irn_op (ir_node *node, ir_op *op);
/* Get the opcode-enum of the node */
inline
opcode
get_irn_opcode
(
ir_node
*
node
);
/* Get the ident for a string representation of the opcode */
inline
ident
*
get_irn_opname
(
ir_node
*
node
);
inline
const
char
*
get_irn_opname
(
ir_node
*
node
);
inline
ident
*
get_irn_opident
(
ir_node
*
node
);
inline
void
set_irn_visited
(
ir_node
*
node
,
unsigned
long
visited
);
inline
unsigned
long
get_irn_visited
(
ir_node
*
node
);
inline
void
set_irn_link
(
ir_node
*
node
,
ir_node
*
link
);
...
...
@@ -168,6 +169,7 @@ inline void set_Call_mem (ir_node *node, ir_node *mem);
inline
ir_node
*
get_Call_ptr
(
ir_node
*
node
);
inline
void
set_Call_ptr
(
ir_node
*
node
,
ir_node
*
ptr
);
inline
ir_node
**
get_Call_param_arr
(
ir_node
*
node
);
inline
int
get_Call_n_params
(
ir_node
*
node
);
inline
int
get_Call_arity
(
ir_node
*
node
);
/* inline void set_Call_arity (ir_node *node, ir_node *arity); */
inline
ir_node
*
get_Call_param
(
ir_node
*
node
,
int
pos
);
...
...
@@ -396,9 +398,9 @@ int is_fragile_op(ir_node *node);
#define DDMSG printf("%s(l.%i)\n", __FUNCTION__, __LINE__)
#define DDMSG1(X) printf("%s(l.%i) %s\n", __FUNCTION__, __LINE__, \
id_to_str(get_irn_op
name
(X)))
id_to_str(get_irn_op
ident
(X)))
#define DDMSG2(X) printf("%s(l.%i) %s: %ld\n", __FUNCTION__, __LINE__, \
id_to_str(get_irn_op
name
(X)), get_irn_node_nr(X))
id_to_str(get_irn_op
ident
(X)), get_irn_node_nr(X))
#define DDMSG3(X) printf("%s(l.%i) %s: %p\n", __FUNCTION__, __LINE__, \
print_firm_kind(X), (X))
...
...
ir/ir/irnode_t.h
View file @
3d16844c
...
...
@@ -11,6 +11,7 @@
# include "irnode.h"
# include "xprintf.h"
# include "irop_t.h"
/** ir node attributes **/
/* Block attributes */
...
...
ir/ir/irop.c
View file @
3d16844c
...
...
@@ -5,7 +5,7 @@
**
*/
# include "irop.h"
# include "irop
_t
.h"
# include "irnode_t.h"
# include "misc.h"
...
...
ir/ir/irop.h
View file @
3d16844c
...
...
@@ -30,12 +30,7 @@ typedef enum {
iro_Proj
,
iro_Tuple
,
iro_Id
,
iro_Bad
}
opcode
;
typedef
struct
{
opcode
code
;
ident
*
name
;
size_t
attr_size
;
int
labeled
;
}
ir_op
;
typedef
struct
ir_op
ir_op
;
extern
ir_op
*
op_Block
;
...
...
@@ -85,14 +80,13 @@ extern ir_op *op_Proj;
extern
ir_op
*
op_Id
;
extern
ir_op
*
op_Bad
;
/* create a new ir operation */
ir_op
*
new_ir_op
(
opcode
code
,
ident
*
name
,
size_t
attr_size
,
int
labeled
);
/* initialize the irop module */
void
init_op
(
void
);
/* returns the attribute size of the operator. */
int
get_op_attr_size
(
ir_op
*
op
);
/* Returns the string for the opcode. */
const
char
*
get_op_name
(
ir_op
*
op
);
# endif
/* _IROP_H_ */
ir/ir/irop_t.h
0 → 100644
View file @
3d16844c
# ifndef _IROP_T_H_
# define _IROP_T_H_
# include "irop.h"
struct
ir_op
{
opcode
code
;
ident
*
name
;
size_t
attr_size
;
int
labeled
;
};
/* create a new ir operation */
ir_op
*
new_ir_op
(
opcode
code
,
ident
*
name
,
size_t
attr_size
,
int
labeled
);
/* initialize the irop module */
void
init_op
(
void
);
#endif
ir/tr/Makefile
View file @
3d16844c
...
...
@@ -34,6 +34,7 @@ HFILES += common.h debug.h gmp.h host.h ident.h irgraph.h \
obst.h pset.h set.h tv.h xprintf.h xp_help.h entity_t.h
DISTRIB
=
$(DISTRIBMEMBERS:.m=.h)
DISTRIB
+=
type_or_entity.h
OFILES
=
$
(
MEMBERS:%.m
=
../objects/%.o
)
...
...
ir/tr/entity.c
View file @
3d16844c
...
...
@@ -57,17 +57,11 @@ new_entity (type *owner, ident *name, type *type)
return
res
;
}
#if 0
inline char *
inline
const
char
*
get_entity_name
(
entity
*
ent
)
{
assert
(
ent
);
return
id_to_str
(
get_entity_ident
(
ent
));
/* GL:
entity.c:52: warning: return discards `const' from pointer target type
-- ned so guud
*/
}
#endif
ident
*
get_entity_ident
(
entity
*
ent
)
{
...
...
ir/tr/type.c
View file @
3d16844c
...
...
@@ -258,6 +258,12 @@ void set_method_name (type_method *method, char *name);
void set_method_ident (type_method *method, ident* ident);
*/
inline
int
get_method_n_params
(
type_method
*
method
)
{
return
method
->
arity
;
}
inline
int
get_method_arity
(
type_method
*
method
)
{
return
method
->
arity
;
...
...
ir/tr/type.h
View file @
3d16844c
...
...
@@ -183,8 +183,6 @@ or lowering phases.
# include "common.h"
# include "ident.h"
# include "irmode.h"
/*CS*/
//# include "entity.h"
#ifndef _ENTITY_TYPEDEF_
#define _ENTITY_TYPEDEF_
...
...
@@ -310,6 +308,7 @@ ident *get_method_ident (type_method *method);
void set_method_name (type_method *method, char *name);
void set_method_ident (type_method *method, ident* ident); */
inline
int
get_method_n_params
(
type_method
*
method
);
inline
int
get_method_arity
(
type_method
*
method
);
/*inline void set_method_arity (type_method *method, int arity);*/
inline
type
*
get_method_param_type
(
type_method
*
method
,
int
pos
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment