summaryrefslogtreecommitdiff
path: root/passes/techmap/extract.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/techmap/extract.cc')
-rw-r--r--passes/techmap/extract.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/passes/techmap/extract.cc b/passes/techmap/extract.cc
index eaa0f9fa..221e9e49 100644
--- a/passes/techmap/extract.cc
+++ b/passes/techmap/extract.cc
@@ -609,13 +609,14 @@ struct ExtractPass : public Pass {
}
else
{
- FILE *f = fopen(filename.c_str(), "rt");
- if (f == NULL) {
+ std::ifstream f;
+ f.open(filename.c_str());
+ if (f.fail()) {
delete map;
log_cmd_error("Can't open map file `%s'.\n", filename.c_str());
}
- Frontend::frontend_call(map, f, filename, (filename.size() > 3 && filename.substr(filename.size()-3) == ".il") ? "ilang" : "verilog");
- fclose(f);
+ Frontend::frontend_call(map, &f, filename, (filename.size() > 3 && filename.substr(filename.size()-3) == ".il") ? "ilang" : "verilog");
+ f.close();
if (filename.size() <= 3 || filename.substr(filename.size()-3) != ".il") {
Pass::call(map, "proc");