projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added test case for pbqp construction: There seems to be missing skip patterns, so...
[libfirm]
/
ir
/
be
/
bemain.c
diff --git
a/ir/be/bemain.c
b/ir/be/bemain.c
index
cb3bbb7
..
e41b4d9
100644
(file)
--- a/
ir/be/bemain.c
+++ b/
ir/be/bemain.c
@@
-240,10
+240,10
@@
void be_init_default_asm_constraint_flags(void)
asm_constraint_flags['\r'] = ASM_CONSTRAINT_FLAG_NO_SUPPORT;
}
asm_constraint_flags['\r'] = ASM_CONSTRAINT_FLAG_NO_SUPPORT;
}
-asm_constraint_flags_t parse_asm_constraints(const char *constraint)
+asm_constraint_flags_t
be_
parse_asm_constraints(const char *constraint)
{
{
+ asm_constraint_flags_t flags = 0;
const char *c;
const char *c;
- asm_constraint_flags_t flags;
asm_constraint_flags_t tflags;
for (c = constraint; *c != '\0'; ++c) {
asm_constraint_flags_t tflags;
for (c = constraint; *c != '\0'; ++c) {
@@
-273,22
+273,35
@@
asm_constraint_flags_t parse_asm_constraints(const char *constraint)
}
}
}
}
- if ( ((flags & ASM_CONSTRAINT_FLAG_MODIFIER_WRITE)
- && (flags & ASM_CONSTRAINT_FLAG_MODIFIER_NO_WRITE))
- || ((flags & ASM_CONSTRAINT_FLAG_MODIFIER_READ
- && (flags & ASM_CONSTRAINT_FLAG_MODIFIER_NO_READ)))) {
+ if ((
+ flags & ASM_CONSTRAINT_FLAG_MODIFIER_WRITE &&
+ flags & ASM_CONSTRAINT_FLAG_MODIFIER_NO_WRITE
+ ) || (
+ flags & ASM_CONSTRAINT_FLAG_MODIFIER_READ &&
+ flags & ASM_CONSTRAINT_FLAG_MODIFIER_NO_READ
+ )) {
flags |= ASM_CONSTRAINT_FLAG_INVALID;
}
flags |= ASM_CONSTRAINT_FLAG_INVALID;
}
+ if (!(flags & (ASM_CONSTRAINT_FLAG_MODIFIER_READ |
+ ASM_CONSTRAINT_FLAG_MODIFIER_WRITE |
+ ASM_CONSTRAINT_FLAG_MODIFIER_NO_WRITE |
+ ASM_CONSTRAINT_FLAG_MODIFIER_NO_READ)
+ )) {
+ flags |= ASM_CONSTRAINT_FLAG_MODIFIER_READ;
+ }
return flags;
}
return flags;
}
-
bool
is_valid_clobber(const char *clobber)
+
int be_
is_valid_clobber(const char *clobber)
{
/* memory is a valid clobber. (the frontend has to detect this case too,
* because it has to add memory edges to the asm) */
if (strcmp(clobber, "memory") == 0)
{
/* memory is a valid clobber. (the frontend has to detect this case too,
* because it has to add memory edges to the asm) */
if (strcmp(clobber, "memory") == 0)
- return true;
+ return 1;
+ /* cc (condition code) is always valid */
+ if (strcmp(clobber, "cc") == 0)
+ return 1;
return isa_if->is_valid_clobber(isa_if, clobber);
}
return isa_if->is_valid_clobber(isa_if, clobber);
}
@@
-359,6
+372,12
@@
void firm_be_init(void)
be_init_modules();
}
be_init_modules();
}
+/* Finalize the Firm backend. */
+void firm_be_finish(void)
+{
+ be_quit_modules();
+}
+
/* Returns the backend parameter */
const backend_params *be_get_backend_param(void)
{
/* Returns the backend parameter */
const backend_params *be_get_backend_param(void)
{
@@
-880,10
+899,10
@@
void be_main(FILE *file_handle, const char *cup_name)
ir_timer_t *t = NULL;
/* The user specified another config file to read. do that now. */
ir_timer_t *t = NULL;
/* The user specified another config file to read. do that now. */
- if
(strlen(config_file) > 0
) {
+ if
(config_file[0] != '\0'
) {
FILE *f;
FILE *f;
- if((f = fopen(config_file, "rt")) != NULL) {
+ if
((f = fopen(config_file, "rt")) != NULL) {
lc_opt_from_file(config_file, f, NULL);
fclose(f);
}
lc_opt_from_file(config_file, f, NULL);
fclose(f);
}