shengdump: use StdioFile

This commit is contained in:
Justin Viiret 2017-06-29 13:10:40 +10:00 committed by Matthew Barr
parent 08e094748c
commit 63f3718c79

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, Intel Corporation * Copyright (c) 2016-2017, Intel Corporation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -41,7 +41,6 @@
#include "util/dump_util.h" #include "util/dump_util.h"
#include "util/simd_types.h" #include "util/simd_types.h"
#ifndef DUMP_SUPPORT #ifndef DUMP_SUPPORT
#error No dump support! #error No dump support!
#endif #endif
@ -267,12 +266,8 @@ void nfaExecSheng_dumpDot(const NFA *nfa, FILE *f) {
void nfaExecSheng_dump(const NFA *nfa, const string &base) { void nfaExecSheng_dump(const NFA *nfa, const string &base) {
assert(nfa->type == SHENG_NFA); assert(nfa->type == SHENG_NFA);
FILE *f = fopen_or_throw((base + ".txt").c_str(), "w"); nfaExecSheng_dumpText(nfa, StdioFile(base + ".txt", "w"));
nfaExecSheng_dumpText(nfa, f); nfaExecSheng_dumpDot(nfa, StdioFile(base + ".dot", "w"));
fclose(f);
f = fopen_or_throw((base + ".dot").c_str(), "w");
nfaExecSheng_dumpDot(nfa, f);
fclose(f);
} }
} // namespace ue2 } // namespace ue2