X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbemain.c;h=e41b4d958f2f51f530cf971156cbef90bd318d06;hb=a4c23fb5fdcaf600f18b4fa7b7e104fa9b7dc514;hp=cb3bbb714d7479e8595d69a2653fdfb1a37cddf9;hpb=3f0b6e8217576d23654d406170c543a791edac56;p=libfirm diff --git a/ir/be/bemain.c b/ir/be/bemain.c index cb3bbb714..e41b4d958 100644 --- 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_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) { @@ -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; } + 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); } @@ -359,6 +372,12 @@ void firm_be_init(void) 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) { @@ -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. */ - 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); }