Support filename rewrite in backends
authorBen Widawsky <ben@bwidawsk.net>
Mon, 17 Jun 2019 21:45:48 +0000 (14:45 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Tue, 18 Jun 2019 21:39:52 +0000 (14:39 -0700)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
backends/aiger/aiger.cc
backends/ilang/ilang_backend.cc
backends/json/json.cc
backends/protobuf/protobuf.cc

index dfe506c662278be9aec459ada19da09ce8cc0f3f..d685c56380b2c2e2a94cb7d759c6e4cc8c787a62 100644 (file)
@@ -776,6 +776,7 @@ struct AigerBackend : public Backend {
                writer.write_aiger(*f, ascii_mode, miter_mode, symbols_mode);
 
                if (!map_filename.empty()) {
+                       rewrite_filename(filename);
                        std::ofstream mapf;
                        mapf.open(map_filename.c_str(), std::ofstream::trunc);
                        if (mapf.fail())
index 04d1ee311ffa11923d7a043b7c02d8744538c1a6..b4ba2b03f2d403ea6ca9b80d6de9b0ca19934ae0 100644 (file)
@@ -483,6 +483,7 @@ struct DumpPass : public Pass {
                std::stringstream buf;
 
                if (!filename.empty()) {
+                       rewrite_filename(filename);
                        std::ofstream *ff = new std::ofstream;
                        ff->open(filename.c_str(), append ? std::ofstream::app : std::ofstream::trunc);
                        if (ff->fail()) {
index f5c687981311febd5e004ea0908ebcde3864fa4f..5022d5da169ba67ba435193ccb92ff8452c8ede1 100644 (file)
@@ -525,6 +525,7 @@ struct JsonPass : public Pass {
                std::stringstream buf;
 
                if (!filename.empty()) {
+                       rewrite_filename(filename);
                        std::ofstream *ff = new std::ofstream;
                        ff->open(filename.c_str(), std::ofstream::trunc);
                        if (ff->fail()) {
index 549fc73aea7c2efd62fb9d93d528060d5c209218..fff110bb01fc43c68118783ab3f05f3ddf767fba 100644 (file)
@@ -336,6 +336,7 @@ struct ProtobufPass : public Pass {
                std::stringstream buf;
 
                if (!filename.empty()) {
+                       rewrite_filename(filename);
                        std::ofstream *ff = new std::ofstream;
                        ff->open(filename.c_str(), std::ofstream::trunc);
                        if (ff->fail()) {