/*
* This file is part of cparser.
- * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
*/
#include <config.h>
#else
/* escape stuff... */
for (char *c = buf; *c != '\0'; ++c) {
- switch(*c) {
+ switch (*c) {
case ' ':
case '"':
case '$':
}
FILE *f = popen(commandline, "r");
if (f == NULL) {
- source_position_t const pos = { unit->name, 0, 0, 0 };
+ position_t const pos = { unit->name, 0, 0, 0 };
errorf(&pos, "invoking preprocessor failed");
return false;
}
}
int err = system(commandline);
if (err != EXIT_SUCCESS) {
- source_position_t const pos = { in, 0, 0, 0 };
+ position_t const pos = { in, 0, 0, 0 };
errorf(&pos, "assembler reported an error");
exit(EXIT_FAILURE);
}
}
int err = system(commandline);
if (err != EXIT_SUCCESS) {
- source_position_t const pos = { file, 0, 0, 0 };
+ position_t const pos = { file, 0, 0, 0 };
errorf(&pos, "linker reported an error");
exit(EXIT_FAILURE);
}
char *name = obstack_finish(&file_obst);
int fd = mkstemp(name);
if (fd == -1) {
- source_position_t const pos = { name, 0, 0, 0 };
+ position_t const pos = { name, 0, 0, 0 };
errorf(&pos, "could not create temporary file: %s", strerror(errno));
return NULL;
}
FILE *out = fdopen(fd, "w");
if (out == NULL) {
- source_position_t const pos = { name, 0, 0, 0 };
+ position_t const pos = { name, 0, 0, 0 };
errorf(&pos, "could not open temporary file as FILE*");
return NULL;
}
} else {
unit->input = fopen(inputname, "r");
if (unit->input == NULL) {
- source_position_t const pos = { inputname, 0, 0, 0 };
+ position_t const pos = { inputname, 0, 0, 0 };
errorf(&pos, "could not open: %s", strerror(errno));
return false;
}
}
res = !ir_import_file(unit->input, unit->name);
if (!res) {
- source_position_t const pos = { inputname, 0, 0, 0 };
+ position_t const pos = { inputname, 0, 0, 0 };
errorf(&pos, "import of firm graph failed");
result = EXIT_FAILURE;
break;
} else if (option[0] == 'g') {
/* TODO: parse -gX with 0<=x<=3... */
set_be_option("debug=frameinfo");
- set_be_option("ia32-nooptcc=yes");
+ set_be_option("ia32-optcc=false");
} else if (SINGLE_OPTION('c')) {
mode = CompileAssemble;
} else if (SINGLE_OPTION('E')) {
if (outname == NULL) {
const char *filename = units->name;
- switch(mode) {
+ switch (mode) {
case BenchmarkParser:
case PrintAst:
case PrintFluffy:
} else {
out = fopen(outname, "w");
if (out == NULL) {
- source_position_t const pos = { outname, 0, 0, 0 };
+ position_t const pos = { outname, 0, 0, 0 };
errorf(&pos, "could not open for writing: %s", strerror(errno));
return EXIT_FAILURE;
}