rose_build: reduce size/scope of context objects

This commit is contained in:
Alex Coyte
2017-03-30 14:34:33 +11:00
committed by Matthew Barr
parent a2b2940f85
commit 37cb93e60f
14 changed files with 520 additions and 458 deletions

View File

@@ -29,6 +29,9 @@
#ifndef ROSE_BUILD_DUMP_H
#define ROSE_BUILD_DUMP_H
#include "ue2common.h"
#include <map>
#include <string>
#include <vector>
@@ -39,30 +42,40 @@ namespace ue2 {
class RoseBuildImpl;
struct Grey;
struct hwlmLiteral;
struct LitFragment;
struct left_id;
struct suffix_id;
#ifdef DUMP_SUPPORT
// Dump the Rose graph in graphviz representation.
void dumpRoseGraph(const RoseBuildImpl &build, const RoseEngine *t,
const char *filename);
void dumpRoseGraph(const RoseBuildImpl &build, const char *filename);
void dumpRose(const RoseBuildImpl &build, const RoseEngine *t);
void dumpRose(const RoseBuildImpl &build,
const std::vector<LitFragment> &fragments,
const std::map<left_id, u32> &leftfix_queue_map,
const std::map<suffix_id, u32> &suffix_queue_map,
const RoseEngine *t);
void dumpMatcherLiterals(const std::vector<hwlmLiteral> &lits,
const std::string &name, const Grey &grey);
#else
static UNUSED
void dumpRoseGraph(const RoseBuildImpl &, const RoseEngine *, const char *) {
void dumpRoseGraph(const RoseBuildImpl &, const char *) {
}
static UNUSED
void dumpRose(const RoseBuildImpl &, const RoseEngine *) {
void dumpRose(const RoseBuildImpl &, const std::vector<LitFragment> &,
const std::map<left_id, u32> &, const std::map<suffix_id, u32> &,
const RoseEngine *) {
}
static UNUSED
void dumpMatcherLiterals(const std::vector<hwlmLiteral> &, const std::string &,
const Grey &) {
}
#endif
} // namespace ue2