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;
- asm_constraint_flags_t flags;
asm_constraint_flags_t tflags;
for (c = constraint; *c != '\0'; ++c) {
}
}
- 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;
}
+ 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;
}
-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)
- 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);
}
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)
{
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;
- if((f = fopen(config_file, "rt")) != NULL) {
+ if ((f = fopen(config_file, "rt")) != NULL) {
lc_opt_from_file(config_file, f, NULL);
fclose(f);
}