mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
use STL make_unique, remove wrapper header, breaks C++17 compilation
This commit is contained in:
parent
f5f37f3f40
commit
e35b88f2c8
@ -39,7 +39,6 @@
|
||||
#include "hs_internal.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/compile_error.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/multibit_build.h"
|
||||
#include "util/target_info.h"
|
||||
|
||||
@ -495,7 +494,7 @@ void ch_compile_multi_int(const char *const *expressions, const unsigned *flags,
|
||||
// First, build with libpcre. A build failure from libpcre will throw
|
||||
// an exception up to the caller.
|
||||
auto patternData =
|
||||
ue2::make_unique<PatternData>(myExpr, myFlags, i, myId, mode, match_limit,
|
||||
std::make_unique<PatternData>(myExpr, myFlags, i, myId, mode, match_limit,
|
||||
match_limit_recursion, platform);
|
||||
pcres.push_back(move(patternData));
|
||||
PatternData &curr = *pcres.back();
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "util/compare.h"
|
||||
#include "util/container.h"
|
||||
#include "util/dump_mask.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/math.h"
|
||||
#include "util/noncopyable.h"
|
||||
#include "util/target_info.h"
|
||||
@ -868,7 +867,7 @@ unique_ptr<HWLMProto> fdrBuildProtoInternal(u8 engType,
|
||||
auto bucketToLits = assignStringsToBuckets(lits, *des);
|
||||
addIncludedInfo(lits, des->getNumBuckets(), bucketToLits);
|
||||
auto proto =
|
||||
ue2::make_unique<HWLMProto>(engType, move(des), lits, bucketToLits,
|
||||
std::make_unique<HWLMProto>(engType, move(des), lits, bucketToLits,
|
||||
make_small);
|
||||
return proto;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "hs_compile.h"
|
||||
#include "util/target_info.h"
|
||||
#include "util/compare.h" // for ourisalpha()
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
@ -196,7 +195,7 @@ unique_ptr<FDREngineDescription> chooseEngine(const target_t &target,
|
||||
}
|
||||
|
||||
DEBUG_PRINTF("using engine %u\n", best->getID());
|
||||
return ue2::make_unique<FDREngineDescription>(*best);
|
||||
return std::make_unique<FDREngineDescription>(*best);
|
||||
}
|
||||
|
||||
SchemeBitIndex FDREngineDescription::getSchemeBit(BucketIndex b,
|
||||
@ -222,7 +221,7 @@ unique_ptr<FDREngineDescription> getFdrDescription(u32 engineID) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ue2::make_unique<FDREngineDescription>(allDescs[engineID]);
|
||||
return std::make_unique<FDREngineDescription>(allDescs[engineID]);
|
||||
}
|
||||
|
||||
} // namespace ue2
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "util/alloc.h"
|
||||
#include "util/compare.h"
|
||||
#include "util/container.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/noncopyable.h"
|
||||
#include "util/popcount.h"
|
||||
#include "util/small_vector.h"
|
||||
@ -677,7 +676,7 @@ unique_ptr<HWLMProto> teddyBuildProtoHinted(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ue2::make_unique<HWLMProto>(engType, move(des), lits,
|
||||
return std::make_unique<HWLMProto>(engType, move(des), lits,
|
||||
bucketToLits, make_small);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "fdr_engine_description.h"
|
||||
#include "teddy_internal.h"
|
||||
#include "teddy_engine_description.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -197,7 +196,7 @@ chooseTeddyEngine(const target_t &target, const vector<hwlmLiteral> &vl) {
|
||||
}
|
||||
|
||||
DEBUG_PRINTF("using engine %u\n", best->getID());
|
||||
return ue2::make_unique<TeddyEngineDescription>(*best);
|
||||
return std::make_unique<TeddyEngineDescription>(*best);
|
||||
}
|
||||
|
||||
unique_ptr<TeddyEngineDescription> getTeddyDescription(u32 engineID) {
|
||||
@ -206,7 +205,7 @@ unique_ptr<TeddyEngineDescription> getTeddyDescription(u32 engineID) {
|
||||
|
||||
for (const auto &desc : descs) {
|
||||
if (desc.getID() == engineID) {
|
||||
return ue2::make_unique<TeddyEngineDescription>(desc);
|
||||
return std::make_unique<TeddyEngineDescription>(desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "fdr/teddy_engine_description.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/compile_error.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/ue2string.h"
|
||||
|
||||
#include <cassert>
|
||||
@ -201,7 +200,7 @@ hwlmBuildProto(vector<hwlmLiteral> &lits, bool make_small,
|
||||
|
||||
if (isNoodleable(lits, cc)) {
|
||||
DEBUG_PRINTF("build noodle table\n");
|
||||
proto = ue2::make_unique<HWLMProto>(HWLM_ENGINE_NOOD, lits);
|
||||
proto = std::make_unique<HWLMProto>(HWLM_ENGINE_NOOD, lits);
|
||||
} else {
|
||||
DEBUG_PRINTF("building a new deal\n");
|
||||
proto = fdrBuildProto(HWLM_ENGINE_FDR, lits, make_small,
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/multibit_build.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/verify_types.h"
|
||||
@ -977,7 +976,7 @@ unique_ptr<NGHolder> makeHolder(const CastleProto &proto,
|
||||
}
|
||||
}
|
||||
|
||||
auto g = ue2::make_unique<NGHolder>(proto.kind);
|
||||
auto g = std::make_unique<NGHolder>(proto.kind);
|
||||
|
||||
for (const auto &m : proto.repeats) {
|
||||
addToHolder(*g, m.first, m.second);
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/verify_types.h"
|
||||
@ -348,7 +347,7 @@ static never_inline
|
||||
unique_ptr<GoughGraph> makeCFG(const raw_som_dfa &raw) {
|
||||
vector<GoughVertex> vertices;
|
||||
vertices.reserve(raw.states.size());
|
||||
unique_ptr<GoughGraph> cfg = ue2::make_unique<GoughGraph>();
|
||||
unique_ptr<GoughGraph> cfg = std::make_unique<GoughGraph>();
|
||||
u32 min_state = !is_triggered(raw.kind);
|
||||
|
||||
if (min_state) {
|
||||
@ -1235,7 +1234,7 @@ unique_ptr<raw_report_info> gough_build_strat::gatherReports(
|
||||
|
||||
const bool remap_reports = has_managed_reports(rdfa.kind);
|
||||
|
||||
auto ri = ue2::make_unique<raw_gough_report_info_impl>();
|
||||
auto ri = std::make_unique<raw_gough_report_info_impl>();
|
||||
map<raw_gough_report_list, u32> rev;
|
||||
|
||||
assert(!rdfa.states.empty());
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "util/compare.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/container.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/flat_containers.h"
|
||||
@ -393,7 +392,7 @@ unique_ptr<raw_report_info> mcclellan_build_strat::gatherReports(
|
||||
|
||||
const bool remap_reports = has_managed_reports(rdfa.kind);
|
||||
|
||||
auto ri = ue2::make_unique<raw_report_info_impl>();
|
||||
auto ri = std::make_unique<raw_report_info_impl>();
|
||||
map<raw_report_list, u32> rev;
|
||||
|
||||
for (const dstate &s : rdfa.states) {
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/unaligned.h"
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/determinise.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/unordered.h"
|
||||
|
||||
@ -287,7 +286,7 @@ unique_ptr<raw_dfa> mergeTwoDfas(const raw_dfa *d1, const raw_dfa *d2,
|
||||
assert(d1->kind == d2->kind);
|
||||
assert(max_states <= MAX_DFA_STATES);
|
||||
|
||||
auto rdfa = ue2::make_unique<raw_dfa>(d1->kind);
|
||||
auto rdfa = std::make_unique<raw_dfa>(d1->kind);
|
||||
|
||||
Automaton_Merge autom(d1, d2, rm, grey);
|
||||
if (determinise(autom, rdfa->states, max_states)) {
|
||||
@ -370,7 +369,7 @@ unique_ptr<raw_dfa> mergeAllDfas(const vector<const raw_dfa *> &dfas,
|
||||
assert(all_of(begin(dfas), end(dfas),
|
||||
[&kind](const raw_dfa *rdfa) { return rdfa->kind == kind; }));
|
||||
|
||||
auto rdfa = ue2::make_unique<raw_dfa>(kind);
|
||||
auto rdfa = std::make_unique<raw_dfa>(kind);
|
||||
Automaton_Merge n(dfas, rm, grey);
|
||||
|
||||
DEBUG_PRINTF("merging dfa\n");
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "sheng_internal.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/verify_types.h"
|
||||
#include "util/simd_types.h"
|
||||
|
||||
@ -203,7 +202,7 @@ unique_ptr<raw_report_info> sheng_build_strat::gatherReports(
|
||||
|
||||
const bool remap_reports = has_managed_reports(rdfa.kind);
|
||||
|
||||
auto ri = ue2::make_unique<raw_report_info_impl>();
|
||||
auto ri = std::make_unique<raw_report_info_impl>();
|
||||
map<raw_report_list, u32> rev;
|
||||
|
||||
for (const dstate &s : rdfa.states) {
|
||||
|
@ -71,7 +71,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/depth.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/ue2string.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "ue2common.h"
|
||||
#include "compiler/compiler.h" // for ParsedExpression
|
||||
#include "util/compile_error.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@ -114,7 +113,7 @@ private:
|
||||
|
||||
NFABuilderImpl::NFABuilderImpl(ReportManager &rm_in, const Grey &grey_in,
|
||||
const ParsedExpression &parsed)
|
||||
: rm(rm_in), grey(grey_in), graph(ue2::make_unique<NGHolder>()),
|
||||
: rm(rm_in), grey(grey_in), graph(std::make_unique<NGHolder>()),
|
||||
expr(parsed.expr), vertIdx(N_SPECIALS) {
|
||||
|
||||
// Reserve space for a reasonably-sized NFA
|
||||
@ -270,7 +269,7 @@ void NFABuilderImpl::cloneRegion(Position first, Position last, unsigned posOffs
|
||||
|
||||
unique_ptr<NFABuilder> makeNFABuilder(ReportManager &rm, const CompileContext &cc,
|
||||
const ParsedExpression &expr) {
|
||||
return ue2::make_unique<NFABuilderImpl>(rm, cc.grey, expr);
|
||||
return std::make_unique<NFABuilderImpl>(rm, cc.grey, expr);
|
||||
}
|
||||
|
||||
NFABuilder::~NFABuilder() { }
|
||||
|
@ -58,7 +58,6 @@
|
||||
#include "ue2common.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/graph_undirected.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@ -355,7 +354,7 @@ void splitIntoComponents(unique_ptr<NGHolder> g,
|
||||
* no deterministic ordering (split_components map). */
|
||||
sort(begin(vv), end(vv));
|
||||
|
||||
auto gc = ue2::make_unique<NGHolder>();
|
||||
auto gc = std::make_unique<NGHolder>();
|
||||
v_map.clear();
|
||||
fillHolder(gc.get(), *g, vv, &v_map);
|
||||
|
||||
@ -379,7 +378,7 @@ void splitIntoComponents(unique_ptr<NGHolder> g,
|
||||
vv.insert(vv.end(), begin(head_shell), end(head_shell));
|
||||
vv.insert(vv.end(), begin(tail_shell), end(tail_shell));
|
||||
|
||||
auto gc = ue2::make_unique<NGHolder>();
|
||||
auto gc = std::make_unique<NGHolder>();
|
||||
v_map.clear();
|
||||
fillHolder(gc.get(), *g, vv, &v_map);
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "util/compile_context.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/unordered.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -269,7 +268,7 @@ vector<unique_ptr<VertexInfo>> getVertexInfos(const NGHolder &g) {
|
||||
vertex_map.resize(num_verts);
|
||||
|
||||
for (auto v : vertices_range(g)) {
|
||||
infos.emplace_back(make_unique<VertexInfo>(v, g));
|
||||
infos.emplace_back(std::make_unique<VertexInfo>(v, g));
|
||||
vertex_map[g[v].index] = infos.back().get();
|
||||
}
|
||||
|
||||
@ -516,7 +515,7 @@ void mergeClass(vector<unique_ptr<VertexInfo>> &infos, NGHolder &g,
|
||||
g[new_v].reports.clear(); /* populated as we pull in succs */
|
||||
|
||||
// store this vertex in our global vertex list
|
||||
infos.emplace_back(make_unique<VertexInfo>(new_v, g));
|
||||
infos.emplace_back(std::make_unique<VertexInfo>(new_v, g));
|
||||
VertexInfo *new_vertex_info = infos.back().get();
|
||||
|
||||
NFAVertex new_v_eod = NGHolder::null_vertex();
|
||||
@ -525,7 +524,7 @@ void mergeClass(vector<unique_ptr<VertexInfo>> &infos, NGHolder &g,
|
||||
if (require_separate_eod_vertex(cur_class_vertices, g)) {
|
||||
new_v_eod = clone_vertex(g, old_v);
|
||||
g[new_v_eod].reports.clear();
|
||||
infos.emplace_back(make_unique<VertexInfo>(new_v_eod, g));
|
||||
infos.emplace_back(std::make_unique<VertexInfo>(new_v_eod, g));
|
||||
new_vertex_info_eod = infos.back().get();
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "util/graph.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/hash_dynamic_bitset.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/unordered.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -581,7 +580,7 @@ attemptToBuildHaig(const NGHolder &g, som_type som, u32 somPrecision,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto rdfa = ue2::make_unique<raw_som_dfa>(g.kind, unordered_som, NODE_START,
|
||||
auto rdfa = std::make_unique<raw_som_dfa>(g.kind, unordered_som, NODE_START,
|
||||
somPrecision);
|
||||
|
||||
DEBUG_PRINTF("determinising nfa with %u vertices\n", numStates);
|
||||
@ -724,7 +723,7 @@ unique_ptr<raw_som_dfa> attemptToMergeHaig(const vector<const raw_som_dfa *> &df
|
||||
|
||||
using StateSet = Automaton_Haig_Merge::StateSet;
|
||||
vector<StateSet> nfa_state_map;
|
||||
auto rdfa = ue2::make_unique<raw_som_dfa>(dfas[0]->kind, unordered_som,
|
||||
auto rdfa = std::make_unique<raw_som_dfa>(dfas[0]->kind, unordered_som,
|
||||
NODE_START,
|
||||
dfas[0]->stream_som_loc_width);
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "rose/rose_in_util.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "util/graph_range.h"
|
||||
#include "util/hash.h"
|
||||
#include "util/hash_dynamic_bitset.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/report_manager.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -568,7 +567,7 @@ unique_ptr<raw_dfa> buildMcClellan(const NGHolder &graph,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto rdfa = ue2::make_unique<raw_dfa>(graph.kind);
|
||||
auto rdfa = std::make_unique<raw_dfa>(graph.kind);
|
||||
|
||||
if (numStates <= NFA_STATE_LIMIT) {
|
||||
/* Fast path. Automaton_Graph uses a bitfield internally to represent
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
@ -364,7 +363,7 @@ makePrefix(const NGHolder &g, const unordered_map<NFAVertex, u32> ®ions,
|
||||
assert(!next_enters.empty());
|
||||
assert(!curr_exits.empty());
|
||||
|
||||
unique_ptr<NGHolder> prefix_ptr = ue2::make_unique<NGHolder>();
|
||||
unique_ptr<NGHolder> prefix_ptr = std::make_unique<NGHolder>();
|
||||
NGHolder &prefix = *prefix_ptr;
|
||||
|
||||
deque<NFAVertex> lhs_verts;
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "parser/position.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/graph_small_color_map.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/ue2string.h"
|
||||
#include "util/report_manager.h"
|
||||
@ -596,7 +595,7 @@ void cloneHolder(NGHolder &out, const NGHolder &in,
|
||||
}
|
||||
|
||||
unique_ptr<NGHolder> cloneHolder(const NGHolder &in) {
|
||||
unique_ptr<NGHolder> h = ue2::make_unique<NGHolder>();
|
||||
unique_ptr<NGHolder> h = std::make_unique<NGHolder>();
|
||||
cloneHolder(*h, in);
|
||||
return h;
|
||||
}
|
||||
|
@ -62,7 +62,6 @@
|
||||
#include "util/graph_range.h"
|
||||
#include "util/graph_small_color_map.h"
|
||||
#include "util/insertion_ordered.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/target_info.h"
|
||||
#include "util/ue2string.h"
|
||||
@ -70,6 +69,7 @@
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <boost/dynamic_bitset.hpp>
|
||||
#include <boost/range/adaptor/map.hpp>
|
||||
|
||||
@ -375,7 +375,7 @@ void getSimpleRoseLiterals(const NGHolder &g, bool seeking_anchored,
|
||||
|
||||
DEBUG_PRINTF("candidate is a candidate\n");
|
||||
scores[v] = score;
|
||||
lit_info[v] = make_unique<VertLitInfo>(v, s, anchored);
|
||||
lit_info[v] = std::make_unique<VertLitInfo>(v, s, anchored);
|
||||
}
|
||||
|
||||
/* try to filter out cases where appending some characters produces worse
|
||||
@ -531,7 +531,7 @@ void getRegionRoseLiterals(const NGHolder &g, bool seeking_anchored,
|
||||
}
|
||||
|
||||
DEBUG_PRINTF("candidate is a candidate\n");
|
||||
lits->emplace_back(make_unique<VertLitInfo>(vv, s, anchored));
|
||||
lits->emplace_back(std::make_unique<VertLitInfo>(vv, s, anchored));
|
||||
}
|
||||
}
|
||||
|
||||
@ -945,7 +945,7 @@ unique_ptr<VertLitInfo> findSimplePrefixSplit(const NGHolder &g,
|
||||
sanitizeAndCompressAndScore(best_lit_set);
|
||||
}
|
||||
|
||||
return ue2::make_unique<VertLitInfo>(best_v, best_lit_set, anchored, true);
|
||||
return std::make_unique<VertLitInfo>(best_v, best_lit_set, anchored, true);
|
||||
}
|
||||
|
||||
static
|
||||
@ -1835,7 +1835,7 @@ static
|
||||
unique_ptr<NGHolder> make_chain(u32 count) {
|
||||
assert(count);
|
||||
|
||||
auto rv = make_unique<NGHolder>(NFA_INFIX);
|
||||
auto rv = std::make_unique<NGHolder>(NFA_INFIX);
|
||||
|
||||
NGHolder &h = *rv;
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "ucp_table.h"
|
||||
#include "Utf8ComponentClass.h"
|
||||
#include "util/charreach.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
|
||||
@ -399,9 +398,9 @@ CharReach getPredefinedCharReach(PredefinedClass c, const ParseMode &mode) {
|
||||
|
||||
unique_ptr<ComponentClass> getComponentClass(const ParseMode &mode) {
|
||||
if (mode.utf8) {
|
||||
return ue2::make_unique<UTF8ComponentClass>(mode);
|
||||
return std::make_unique<UTF8ComponentClass>(mode);
|
||||
} else {
|
||||
return ue2::make_unique<AsciiComponentClass>(mode);
|
||||
return std::make_unique<AsciiComponentClass>(mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "position_dump.h"
|
||||
#include "position_info.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@ -362,7 +361,7 @@ void ComponentRepeat::postSubNotePositionHook() {
|
||||
unique_ptr<ComponentRepeat> makeComponentRepeat(unique_ptr<Component> sub_comp,
|
||||
u32 min, u32 max,
|
||||
ComponentRepeat::RepeatType t) {
|
||||
return ue2::make_unique<ComponentRepeat>(move(sub_comp), min, max, t);
|
||||
return std::make_unique<ComponentRepeat>(move(sub_comp), min, max, t);
|
||||
}
|
||||
|
||||
} // namespace ue2
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "position_info.h"
|
||||
#include "nfagraph/ng_builder.h"
|
||||
#include "util/container.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@ -140,10 +139,10 @@ bool ComponentSequence::addRepeat(u32 min, u32 max,
|
||||
|
||||
void ComponentSequence::addAlternation() {
|
||||
if (!alternation) {
|
||||
alternation = ue2::make_unique<ComponentAlternation>();
|
||||
alternation = std::make_unique<ComponentAlternation>();
|
||||
}
|
||||
|
||||
auto seq = ue2::make_unique<ComponentSequence>();
|
||||
auto seq = std::make_unique<ComponentSequence>();
|
||||
seq->children.swap(children);
|
||||
alternation->append(move(seq));
|
||||
}
|
||||
|
@ -54,7 +54,6 @@
|
||||
#include "ue2common.h"
|
||||
#include "util/compare.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/unicode_def.h"
|
||||
#include "util/verify_types.h"
|
||||
|
||||
@ -328,7 +327,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
# enter a CAPTURING group ( e.g. '(blah)' )
|
||||
action enterCapturingGroup {
|
||||
PUSH_SEQUENCE;
|
||||
auto seq = ue2::make_unique<ComponentSequence>();
|
||||
auto seq = std::make_unique<ComponentSequence>();
|
||||
seq->setCaptureIndex(groupIndex++);
|
||||
currentSeq = enterSequence(currentSeq, move(seq));
|
||||
}
|
||||
@ -344,7 +343,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
throw LocatedParseError("Two named subpatterns use the name '" + label + "'");
|
||||
}
|
||||
PUSH_SEQUENCE;
|
||||
auto seq = ue2::make_unique<ComponentSequence>();
|
||||
auto seq = std::make_unique<ComponentSequence>();
|
||||
seq->setCaptureIndex(groupIndex++);
|
||||
seq->setCaptureName(label);
|
||||
currentSeq = enterSequence(currentSeq, move(seq));
|
||||
@ -357,7 +356,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
PUSH_SEQUENCE;
|
||||
mode = newMode;
|
||||
currentSeq =
|
||||
enterSequence(currentSeq, ue2::make_unique<ComponentSequence>());
|
||||
enterSequence(currentSeq, std::make_unique<ComponentSequence>());
|
||||
}
|
||||
|
||||
action exitGroup {
|
||||
@ -370,25 +369,25 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
action enterZWLookAhead {
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentAssertion>(ComponentAssertion::LOOKAHEAD,
|
||||
std::make_unique<ComponentAssertion>(ComponentAssertion::LOOKAHEAD,
|
||||
ComponentAssertion::POS));
|
||||
}
|
||||
action enterZWNegLookAhead {
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentAssertion>(ComponentAssertion::LOOKAHEAD,
|
||||
std::make_unique<ComponentAssertion>(ComponentAssertion::LOOKAHEAD,
|
||||
ComponentAssertion::NEG));
|
||||
}
|
||||
action enterZWLookBehind {
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentAssertion>(ComponentAssertion::LOOKBEHIND,
|
||||
std::make_unique<ComponentAssertion>(ComponentAssertion::LOOKBEHIND,
|
||||
ComponentAssertion::POS));
|
||||
}
|
||||
action enterZWNegLookBehind {
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentAssertion>(ComponentAssertion::LOOKBEHIND,
|
||||
std::make_unique<ComponentAssertion>(ComponentAssertion::LOOKBEHIND,
|
||||
ComponentAssertion::NEG));
|
||||
}
|
||||
action enterEmbeddedCode {
|
||||
@ -406,18 +405,18 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
}
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentCondReference>(accumulator));
|
||||
std::make_unique<ComponentCondReference>(accumulator));
|
||||
}
|
||||
action enterNamedConditionalRef {
|
||||
PUSH_SEQUENCE;
|
||||
assert(!label.empty());
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentCondReference>(label));
|
||||
std::make_unique<ComponentCondReference>(label));
|
||||
}
|
||||
action enterAtomicGroup {
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentAtomicGroup>());
|
||||
std::make_unique<ComponentAtomicGroup>());
|
||||
}
|
||||
action eatClass {
|
||||
assert(!currentCls);
|
||||
@ -433,7 +432,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
}
|
||||
action applyModifiers {
|
||||
mode = newMode;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentEmpty>());
|
||||
currentSeq->addComponent(std::make_unique<ComponentEmpty>());
|
||||
}
|
||||
action modifyMatchPositive {
|
||||
switch (fc) {
|
||||
@ -481,7 +480,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
if (accumulator == 0) {
|
||||
throw LocatedParseError("Numbered reference cannot be zero");
|
||||
}
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBackReference>(accumulator));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBackReference>(accumulator));
|
||||
}
|
||||
|
||||
action addNegativeNumberedBackRef {
|
||||
@ -493,11 +492,11 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
throw LocatedParseError("Invalid reference");
|
||||
}
|
||||
unsigned idx = groupIndex - accumulator;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBackReference>(idx));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBackReference>(idx));
|
||||
}
|
||||
|
||||
action addNamedBackRef {
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBackReference>(label));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBackReference>(label));
|
||||
}
|
||||
|
||||
escapedOctal0 = '\\0' @clearOctAccumulator [0-7]{0,2} $appendAccumulatorOctDigit;
|
||||
@ -1305,7 +1304,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
if (mode.utf8) {
|
||||
throw LocatedParseError("\\C is unsupported in UTF8");
|
||||
}
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentByte>());
|
||||
currentSeq->addComponent(std::make_unique<ComponentByte>());
|
||||
};
|
||||
# Match 0 or more times (greedy)
|
||||
'\*' => {
|
||||
@ -1422,39 +1421,39 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
'\^' => {
|
||||
auto bound = mode.multiline ? ComponentBoundary::BEGIN_LINE
|
||||
: ComponentBoundary::BEGIN_STRING;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBoundary>(bound));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBoundary>(bound));
|
||||
};
|
||||
# End of data (with optional internal newline); also before
|
||||
# internal newline in multiline mode
|
||||
'\$' => {
|
||||
auto bound = mode.multiline ? ComponentBoundary::END_LINE
|
||||
: ComponentBoundary::END_STRING_OPTIONAL_LF;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBoundary>(bound));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBoundary>(bound));
|
||||
};
|
||||
# Beginning of data
|
||||
'\\A' => {
|
||||
auto bound = ComponentBoundary::BEGIN_STRING;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBoundary>(bound));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBoundary>(bound));
|
||||
};
|
||||
# End of data (with optional internal newline)
|
||||
'\\Z' => {
|
||||
auto bound = ComponentBoundary::END_STRING_OPTIONAL_LF;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBoundary>(bound));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBoundary>(bound));
|
||||
};
|
||||
# End of data
|
||||
'\\z' => {
|
||||
auto bound = ComponentBoundary::END_STRING;
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBoundary>(bound));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBoundary>(bound));
|
||||
};
|
||||
# Word boundary
|
||||
'\\b' => {
|
||||
currentSeq->addComponent(
|
||||
ue2::make_unique<ComponentWordBoundary>(ts - ptr, false, mode));
|
||||
std::make_unique<ComponentWordBoundary>(ts - ptr, false, mode));
|
||||
};
|
||||
# Non-word boundary
|
||||
'\\B' => {
|
||||
currentSeq->addComponent(
|
||||
ue2::make_unique<ComponentWordBoundary>(ts - ptr, true, mode));
|
||||
std::make_unique<ComponentWordBoundary>(ts - ptr, true, mode));
|
||||
};
|
||||
|
||||
#############################################################
|
||||
@ -1494,7 +1493,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
// a back reference
|
||||
accumulator = parseAsDecimal(octAccumulator);
|
||||
if (accumulator < groupIndex) {
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBackReference>(accumulator));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBackReference>(accumulator));
|
||||
} else {
|
||||
addEscapedOctal(currentSeq, octAccumulator, mode);
|
||||
}
|
||||
@ -1509,7 +1508,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
'\\' backRefId => {
|
||||
// if there are enough left parens to this point, back ref
|
||||
if (accumulator < groupIndex) {
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentBackReference>(accumulator));
|
||||
currentSeq->addComponent(std::make_unique<ComponentBackReference>(accumulator));
|
||||
} else {
|
||||
// Otherwise, we interpret the first three digits as an
|
||||
// octal escape, and the remaining characters stand for
|
||||
@ -1731,7 +1730,7 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
};
|
||||
|
||||
'\\X' => {
|
||||
currentSeq->addComponent(ue2::make_unique<ComponentEUS>(ts - ptr, mode));
|
||||
currentSeq->addComponent(std::make_unique<ComponentEUS>(ts - ptr, mode));
|
||||
};
|
||||
|
||||
# Fall through general escaped character
|
||||
@ -1782,45 +1781,45 @@ unichar readUtf8CodePoint4c(const char *s) {
|
||||
|
||||
# Conditional reference with a positive lookahead assertion
|
||||
'(?(?=' => {
|
||||
auto a = ue2::make_unique<ComponentAssertion>(
|
||||
auto a = std::make_unique<ComponentAssertion>(
|
||||
ComponentAssertion::LOOKAHEAD, ComponentAssertion::POS);
|
||||
ComponentAssertion *a_seq = a.get();
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentCondReference>(move(a)));
|
||||
std::make_unique<ComponentCondReference>(move(a)));
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = a_seq;
|
||||
};
|
||||
# Conditional reference with a negative lookahead assertion
|
||||
'(?(?!' => {
|
||||
auto a = ue2::make_unique<ComponentAssertion>(
|
||||
auto a = std::make_unique<ComponentAssertion>(
|
||||
ComponentAssertion::LOOKAHEAD, ComponentAssertion::NEG);
|
||||
ComponentAssertion *a_seq = a.get();
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentCondReference>(move(a)));
|
||||
std::make_unique<ComponentCondReference>(move(a)));
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = a_seq;
|
||||
};
|
||||
# Conditional reference with a positive lookbehind assertion
|
||||
'(?(?<=' => {
|
||||
auto a = ue2::make_unique<ComponentAssertion>(
|
||||
auto a = std::make_unique<ComponentAssertion>(
|
||||
ComponentAssertion::LOOKBEHIND, ComponentAssertion::POS);
|
||||
ComponentAssertion *a_seq = a.get();
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentCondReference>(move(a)));
|
||||
std::make_unique<ComponentCondReference>(move(a)));
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = a_seq;
|
||||
};
|
||||
# Conditional reference with a negative lookbehind assertion
|
||||
'(?(?<!' => {
|
||||
auto a = ue2::make_unique<ComponentAssertion>(
|
||||
auto a = std::make_unique<ComponentAssertion>(
|
||||
ComponentAssertion::LOOKBEHIND, ComponentAssertion::NEG);
|
||||
ComponentAssertion *a_seq = a.get();
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = enterSequence(currentSeq,
|
||||
ue2::make_unique<ComponentCondReference>(move(a)));
|
||||
std::make_unique<ComponentCondReference>(move(a)));
|
||||
PUSH_SEQUENCE;
|
||||
currentSeq = a_seq;
|
||||
};
|
||||
@ -1953,7 +1952,7 @@ unique_ptr<Component> parse(const char *ptr, ParseMode &globalMode) {
|
||||
flat_set<string> groupNames;
|
||||
|
||||
// Root sequence.
|
||||
unique_ptr<ComponentSequence> rootSeq = ue2::make_unique<ComponentSequence>();
|
||||
unique_ptr<ComponentSequence> rootSeq = std::make_unique<ComponentSequence>();
|
||||
rootSeq->setCaptureIndex(0);
|
||||
|
||||
// Current sequence being appended to
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/hash.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/unordered.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -441,7 +440,7 @@ void GlushkovBuildStateImpl::buildEdges() {
|
||||
// Construct a usable GlushkovBuildState for the outside world.
|
||||
unique_ptr<GlushkovBuildState> makeGlushkovBuildState(NFABuilder &b,
|
||||
bool prefilter) {
|
||||
return ue2::make_unique<GlushkovBuildStateImpl>(b, prefilter);
|
||||
return std::make_unique<GlushkovBuildStateImpl>(b, prefilter);
|
||||
}
|
||||
|
||||
// free functions for utility use
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/insertion_ordered.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/noncopyable.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/report_manager.h"
|
||||
@ -1794,7 +1793,7 @@ bool RoseBuildImpl::addOutfix(const NGHolder &h) {
|
||||
bool RoseBuildImpl::addOutfix(const NGHolder &h, const raw_som_dfa &haig) {
|
||||
DEBUG_PRINTF("haig with %zu states\n", haig.states.size());
|
||||
|
||||
outfixes.emplace_back(OutfixInfo(ue2::make_unique<raw_som_dfa>(haig)));
|
||||
outfixes.emplace_back(OutfixInfo(std::make_unique<raw_som_dfa>(haig)));
|
||||
populateOutfixInfo(outfixes.back(), h, *this);
|
||||
|
||||
return true; /* failure is not yet an option */
|
||||
@ -1802,7 +1801,7 @@ bool RoseBuildImpl::addOutfix(const NGHolder &h, const raw_som_dfa &haig) {
|
||||
|
||||
bool RoseBuildImpl::addOutfix(const raw_puff &rp) {
|
||||
if (!mpv_outfix) {
|
||||
mpv_outfix = make_unique<OutfixInfo>(MpvProto());
|
||||
mpv_outfix = std::make_unique<OutfixInfo>(MpvProto());
|
||||
}
|
||||
|
||||
auto *mpv = mpv_outfix->mpv();
|
||||
@ -1827,7 +1826,7 @@ bool RoseBuildImpl::addOutfix(const raw_puff &rp) {
|
||||
bool RoseBuildImpl::addChainTail(const raw_puff &rp, u32 *queue_out,
|
||||
u32 *event_out) {
|
||||
if (!mpv_outfix) {
|
||||
mpv_outfix = make_unique<OutfixInfo>(MpvProto());
|
||||
mpv_outfix = std::make_unique<OutfixInfo>(MpvProto());
|
||||
}
|
||||
|
||||
auto *mpv = mpv_outfix->mpv();
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/graph.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/ue2string.h"
|
||||
#include "util/verify_types.h"
|
||||
|
||||
@ -300,7 +299,7 @@ unique_ptr<NGHolder> buildMaskLhs(bool anchored, u32 prefix_len,
|
||||
DEBUG_PRINTF("build %slhs len %u/%zu\n", anchored ? "anc " : "", prefix_len,
|
||||
mask.size());
|
||||
|
||||
unique_ptr<NGHolder> lhs = ue2::make_unique<NGHolder>(NFA_PREFIX);
|
||||
unique_ptr<NGHolder> lhs = std::make_unique<NGHolder>(NFA_PREFIX);
|
||||
|
||||
assert(prefix_len);
|
||||
assert(mask.size() >= prefix_len);
|
||||
@ -568,7 +567,7 @@ unique_ptr<NGHolder> buildMaskRhs(const flat_set<ReportID> &reports,
|
||||
assert(suffix_len);
|
||||
assert(mask.size() > suffix_len);
|
||||
|
||||
unique_ptr<NGHolder> rhs = ue2::make_unique<NGHolder>(NFA_SUFFIX);
|
||||
unique_ptr<NGHolder> rhs = std::make_unique<NGHolder>(NFA_SUFFIX);
|
||||
NGHolder &h = *rhs;
|
||||
|
||||
NFAVertex succ = h.accept;
|
||||
@ -751,7 +750,7 @@ static
|
||||
unique_ptr<NGHolder> makeAnchoredGraph(const vector<CharReach> &mask,
|
||||
const flat_set<ReportID> &reports,
|
||||
bool eod) {
|
||||
auto gp = ue2::make_unique<NGHolder>();
|
||||
auto gp = std::make_unique<NGHolder>();
|
||||
NGHolder &g = *gp;
|
||||
|
||||
NFAVertex u = g.start;
|
||||
|
@ -51,7 +51,6 @@
|
||||
#include "util/determinise.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/ue2string.h"
|
||||
#include "util/unordered.h"
|
||||
@ -699,7 +698,7 @@ int addAutomaton(RoseBuildImpl &build, const NGHolder &h, ReportID *remap) {
|
||||
|
||||
Automaton_Holder autom(h);
|
||||
|
||||
auto out_dfa = ue2::make_unique<raw_dfa>(NFA_OUTFIX_RAW);
|
||||
auto out_dfa = std::make_unique<raw_dfa>(NFA_OUTFIX_RAW);
|
||||
if (determinise(autom, out_dfa->states, MAX_DFA_STATES)) {
|
||||
return finalise_out(build, h, autom, move(out_dfa), remap);
|
||||
}
|
||||
@ -761,7 +760,7 @@ void buildSimpleDfas(const RoseBuildImpl &build, const vector<u32> &frag_map,
|
||||
}
|
||||
auto h = populate_holder(simple.first, exit_ids);
|
||||
Automaton_Holder autom(*h);
|
||||
auto rdfa = ue2::make_unique<raw_dfa>(NFA_OUTFIX_RAW);
|
||||
auto rdfa = std::make_unique<raw_dfa>(NFA_OUTFIX_RAW);
|
||||
UNUSED bool rv = determinise(autom, rdfa->states, MAX_DFA_STATES);
|
||||
assert(rv);
|
||||
rdfa->start_anchored = INIT_STATE;
|
||||
|
@ -87,7 +87,6 @@
|
||||
#include "util/fatbit_build.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/insertion_ordered.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/multibit_build.h"
|
||||
#include "util/noncopyable.h"
|
||||
#include "util/order_check.h"
|
||||
@ -1203,7 +1202,7 @@ static
|
||||
unique_ptr<TamaInfo> constructTamaInfo(const RoseGraph &g,
|
||||
const vector<ExclusiveSubengine> &subengines,
|
||||
const bool is_suffix) {
|
||||
unique_ptr<TamaInfo> tamaInfo = ue2::make_unique<TamaInfo>();
|
||||
unique_ptr<TamaInfo> tamaInfo = std::make_unique<TamaInfo>();
|
||||
for (const auto &sub : subengines) {
|
||||
const auto &rose_vertices = sub.vertices;
|
||||
NFA *nfa = sub.nfa.get();
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "util/compile_context.h"
|
||||
#include "util/depth.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/ue2string.h"
|
||||
|
||||
@ -95,7 +94,7 @@ unique_ptr<NGHolder> makeFloodProneSuffix(const ue2_literal &s, size_t len,
|
||||
assert(len < s.length());
|
||||
assert(!reports.empty());
|
||||
|
||||
unique_ptr<NGHolder> h = ue2::make_unique<NGHolder>(NFA_SUFFIX);
|
||||
unique_ptr<NGHolder> h = std::make_unique<NGHolder>(NFA_SUFFIX);
|
||||
|
||||
NFAVertex u = h->start;
|
||||
for (auto it = s.begin() + s.length() - len; it != s.end(); ++it) {
|
||||
@ -114,7 +113,7 @@ unique_ptr<NGHolder> makeFloodProneSuffix(const ue2_literal &s, size_t len,
|
||||
|
||||
static
|
||||
unique_ptr<NGHolder> makeRosePrefix(const ue2_literal &s) {
|
||||
unique_ptr<NGHolder> h = ue2::make_unique<NGHolder>(NFA_PREFIX);
|
||||
unique_ptr<NGHolder> h = std::make_unique<NGHolder>(NFA_PREFIX);
|
||||
|
||||
NFAVertex u = h->startDs;
|
||||
for (const auto &c : s) {
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "smallwrite/smallwrite_build.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/boundary_reports.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/report_manager.h"
|
||||
|
||||
using namespace std;
|
||||
@ -100,7 +99,7 @@ private:
|
||||
};
|
||||
|
||||
unique_ptr<RoseDedupeAux> RoseBuildImpl::generateDedupeAux() const {
|
||||
return ue2::make_unique<RoseDedupeAuxImpl>(*this);
|
||||
return std::make_unique<RoseDedupeAuxImpl>(*this);
|
||||
}
|
||||
|
||||
RoseDedupeAux::~RoseDedupeAux() = default;
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -280,7 +279,7 @@ void findCliques(const map<u32, set<u32>> &exclusiveGroups,
|
||||
}
|
||||
// Construct the exclusivity graph
|
||||
map<u32, CliqueVertex> vertex_map;
|
||||
unique_ptr<CliqueGraph> cg = make_unique<CliqueGraph>();
|
||||
unique_ptr<CliqueGraph> cg = std::make_unique<CliqueGraph>();
|
||||
|
||||
// Add vertices representing infixes/suffixes
|
||||
for (const auto &e : exclusiveGroups) {
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "util/compile_context.h"
|
||||
#include "util/compile_error.h"
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/report.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/verify_types.h"
|
||||
@ -937,7 +936,7 @@ buildFloatingMatcherProto(const RoseBuildImpl &build,
|
||||
throw CompileError("Unable to generate literal matcher proto.");
|
||||
}
|
||||
|
||||
return ue2::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
return std::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
}
|
||||
|
||||
unique_ptr<LitProto>
|
||||
@ -965,7 +964,7 @@ buildDelayRebuildMatcherProto(const RoseBuildImpl &build,
|
||||
throw CompileError("Unable to generate literal matcher proto.");
|
||||
}
|
||||
|
||||
return ue2::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
return std::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
}
|
||||
|
||||
unique_ptr<LitProto>
|
||||
@ -1022,7 +1021,7 @@ buildSmallBlockMatcherProto(const RoseBuildImpl &build,
|
||||
throw CompileError("Unable to generate literal matcher proto.");
|
||||
}
|
||||
|
||||
return ue2::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
return std::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
}
|
||||
|
||||
unique_ptr<LitProto>
|
||||
@ -1047,7 +1046,7 @@ buildEodAnchoredMatcherProto(const RoseBuildImpl &build,
|
||||
throw CompileError("Unable to generate literal matcher proto.");
|
||||
}
|
||||
|
||||
return ue2::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
return std::make_unique<LitProto>(move(proto), mp.accel_lits);
|
||||
}
|
||||
|
||||
} // namespace ue2
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "util/container.h"
|
||||
#include "util/graph.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/order_check.h"
|
||||
#include "util/report_manager.h"
|
||||
#include "util/ue2string.h"
|
||||
@ -234,7 +233,7 @@ unique_ptr<RoseBuild> makeRoseBuilder(ReportManager &rm,
|
||||
SmallWriteBuild &smwr,
|
||||
const CompileContext &cc,
|
||||
const BoundaryReports &boundary) {
|
||||
return ue2::make_unique<RoseBuildImpl>(rm, ssm, smwr, cc, boundary);
|
||||
return std::make_unique<RoseBuildImpl>(rm, ssm, smwr, cc, boundary);
|
||||
}
|
||||
|
||||
bool roseIsPureLiteral(const RoseEngine *t) {
|
||||
|
@ -95,7 +95,7 @@ OffsetMap makeOffsetMap(const RoseProgram &program, u32 *total_len) {
|
||||
}
|
||||
|
||||
RoseProgram::RoseProgram() {
|
||||
prog.emplace_back(make_unique<RoseInstrEnd>());
|
||||
prog.emplace_back(std::make_unique<RoseInstrEnd>());
|
||||
}
|
||||
|
||||
RoseProgram::~RoseProgram() = default;
|
||||
@ -297,28 +297,28 @@ void addEnginesEodProgram(u32 eodNfaIterOffset, RoseProgram &program) {
|
||||
}
|
||||
|
||||
RoseProgram block;
|
||||
block.add_before_end(make_unique<RoseInstrEnginesEod>(eodNfaIterOffset));
|
||||
block.add_before_end(std::make_unique<RoseInstrEnginesEod>(eodNfaIterOffset));
|
||||
program.add_block(move(block));
|
||||
}
|
||||
|
||||
void addSuffixesEodProgram(RoseProgram &program) {
|
||||
RoseProgram block;
|
||||
block.add_before_end(make_unique<RoseInstrSuffixesEod>());
|
||||
block.add_before_end(std::make_unique<RoseInstrSuffixesEod>());
|
||||
program.add_block(move(block));
|
||||
}
|
||||
|
||||
void addMatcherEodProgram(RoseProgram &program) {
|
||||
RoseProgram block;
|
||||
block.add_before_end(make_unique<RoseInstrMatcherEod>());
|
||||
block.add_before_end(std::make_unique<RoseInstrMatcherEod>());
|
||||
program.add_block(move(block));
|
||||
}
|
||||
|
||||
void addFlushCombinationProgram(RoseProgram &program) {
|
||||
program.add_before_end(make_unique<RoseInstrFlushCombination>());
|
||||
program.add_before_end(std::make_unique<RoseInstrFlushCombination>());
|
||||
}
|
||||
|
||||
void addLastFlushCombinationProgram(RoseProgram &program) {
|
||||
program.add_before_end(make_unique<RoseInstrLastFlushCombination>());
|
||||
program.add_before_end(std::make_unique<RoseInstrLastFlushCombination>());
|
||||
}
|
||||
|
||||
static
|
||||
@ -342,11 +342,11 @@ void makeRoleCheckLeftfix(const RoseBuildImpl &build,
|
||||
|
||||
unique_ptr<RoseInstruction> ri;
|
||||
if (is_prefix) {
|
||||
ri = make_unique<RoseInstrCheckPrefix>(lni.queue, build.g[v].left.lag,
|
||||
ri = std::make_unique<RoseInstrCheckPrefix>(lni.queue, build.g[v].left.lag,
|
||||
build.g[v].left.leftfix_report,
|
||||
end_inst);
|
||||
} else {
|
||||
ri = make_unique<RoseInstrCheckInfix>(lni.queue, build.g[v].left.lag,
|
||||
ri = std::make_unique<RoseInstrCheckInfix>(lni.queue, build.g[v].left.lag,
|
||||
build.g[v].left.leftfix_report,
|
||||
end_inst);
|
||||
}
|
||||
@ -384,7 +384,7 @@ void makeAnchoredLiteralDelay(const RoseBuildImpl &build,
|
||||
u32 anch_id = prog_build.anchored_programs.at(lit_id);
|
||||
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrAnchoredDelay>(groups, anch_id, end_inst);
|
||||
auto ri = std::make_unique<RoseInstrAnchoredDelay>(groups, anch_id, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
}
|
||||
|
||||
@ -393,7 +393,7 @@ void makeDedupe(const ReportManager &rm, const Report &report,
|
||||
RoseProgram &program) {
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri =
|
||||
make_unique<RoseInstrDedupe>(report.quashSom, rm.getDkey(report),
|
||||
std::make_unique<RoseInstrDedupe>(report.quashSom, rm.getDkey(report),
|
||||
report.offsetAdjust, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
}
|
||||
@ -402,7 +402,7 @@ static
|
||||
void makeDedupeSom(const ReportManager &rm, const Report &report,
|
||||
RoseProgram &program) {
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrDedupeSom>(report.quashSom,
|
||||
auto ri = std::make_unique<RoseInstrDedupeSom>(report.quashSom,
|
||||
rm.getDkey(report),
|
||||
report.offsetAdjust, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
@ -428,7 +428,7 @@ void makeCatchup(const ReportManager &rm, bool needs_catchup,
|
||||
return;
|
||||
}
|
||||
|
||||
program.add_before_end(make_unique<RoseInstrCatchUp>());
|
||||
program.add_before_end(std::make_unique<RoseInstrCatchUp>());
|
||||
}
|
||||
|
||||
static
|
||||
@ -511,12 +511,12 @@ void addLogicalSetRequired(const Report &report, ReportManager &rm,
|
||||
return;
|
||||
}
|
||||
// set matching status of current lkey
|
||||
auto risl = make_unique<RoseInstrSetLogical>(report.lkey,
|
||||
auto risl = std::make_unique<RoseInstrSetLogical>(report.lkey,
|
||||
report.offsetAdjust);
|
||||
program.add_before_end(move(risl));
|
||||
// set current lkey's corresponding ckeys active, pending to check
|
||||
for (auto ckey : rm.getRelateCKeys(report.lkey)) {
|
||||
auto risc = make_unique<RoseInstrSetCombination>(ckey);
|
||||
auto risc = std::make_unique<RoseInstrSetCombination>(ckey);
|
||||
program.add_before_end(move(risc));
|
||||
}
|
||||
}
|
||||
@ -532,7 +532,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
|
||||
// Handle min/max offset checks.
|
||||
if (report.minOffset > 0 || report.maxOffset < MAX_OFFSET) {
|
||||
auto ri = make_unique<RoseInstrCheckBounds>(report.minOffset,
|
||||
auto ri = std::make_unique<RoseInstrCheckBounds>(report.minOffset,
|
||||
report.maxOffset, end_inst);
|
||||
report_block.add_before_end(move(ri));
|
||||
}
|
||||
@ -540,7 +540,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
// If this report has an exhaustion key, we can check it in the program
|
||||
// rather than waiting until we're in the callback adaptor.
|
||||
if (report.ekey != INVALID_EKEY) {
|
||||
auto ri = make_unique<RoseInstrCheckExhausted>(report.ekey, end_inst);
|
||||
auto ri = std::make_unique<RoseInstrCheckExhausted>(report.ekey, end_inst);
|
||||
report_block.add_before_end(move(ri));
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
// calculated.
|
||||
if (isExternalSomReport(report) &&
|
||||
report.type != EXTERNAL_CALLBACK_SOM_PASS) {
|
||||
auto ri = make_unique<RoseInstrSomFromReport>();
|
||||
auto ri = std::make_unique<RoseInstrSomFromReport>();
|
||||
writeSomOperation(report, &ri->som);
|
||||
report_block.add_before_end(move(ri));
|
||||
}
|
||||
@ -556,13 +556,13 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
// Min length constraint.
|
||||
if (report.minLength > 0) {
|
||||
assert(build.hasSom);
|
||||
auto ri = make_unique<RoseInstrCheckMinLength>(
|
||||
auto ri = std::make_unique<RoseInstrCheckMinLength>(
|
||||
report.offsetAdjust, report.minLength, end_inst);
|
||||
report_block.add_before_end(move(ri));
|
||||
}
|
||||
|
||||
if (report.quashSom) {
|
||||
report_block.add_before_end(make_unique<RoseInstrSomZero>());
|
||||
report_block.add_before_end(std::make_unique<RoseInstrSomZero>());
|
||||
}
|
||||
|
||||
switch (report.type) {
|
||||
@ -578,7 +578,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
if (needs_dedupe) {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrDedupeAndReport>(
|
||||
std::make_unique<RoseInstrDedupeAndReport>(
|
||||
report.quashSom, build.rm.getDkey(report),
|
||||
report.onmatch, report.offsetAdjust, end_inst));
|
||||
} else {
|
||||
@ -587,7 +587,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
} else {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrReport>(
|
||||
std::make_unique<RoseInstrReport>(
|
||||
report.onmatch, report.offsetAdjust));
|
||||
}
|
||||
}
|
||||
@ -597,28 +597,28 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
}
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrReportExhaust>(
|
||||
std::make_unique<RoseInstrReportExhaust>(
|
||||
report.onmatch, report.offsetAdjust, report.ekey));
|
||||
} else {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
std::make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
}
|
||||
}
|
||||
} else { // has_som
|
||||
makeDedupeSom(build.rm, report, report_block);
|
||||
if (report.ekey == INVALID_EKEY) {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(make_unique<RoseInstrReportSom>(
|
||||
report_block.add_before_end(std::make_unique<RoseInstrReportSom>(
|
||||
report.onmatch, report.offsetAdjust));
|
||||
}
|
||||
} else {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrReportSomExhaust>(
|
||||
std::make_unique<RoseInstrReportSomExhaust>(
|
||||
report.onmatch, report.offsetAdjust, report.ekey));
|
||||
} else {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
std::make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -639,17 +639,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
addFlushCombinationProgram(report_block);
|
||||
}
|
||||
if (has_som) {
|
||||
auto ri = make_unique<RoseInstrReportSomAware>();
|
||||
auto ri = std::make_unique<RoseInstrReportSomAware>();
|
||||
writeSomOperation(report, &ri->som);
|
||||
report_block.add_before_end(move(ri));
|
||||
} else {
|
||||
auto ri = make_unique<RoseInstrReportSomInt>();
|
||||
auto ri = std::make_unique<RoseInstrReportSomInt>();
|
||||
writeSomOperation(report, &ri->som);
|
||||
report_block.add_before_end(move(ri));
|
||||
}
|
||||
break;
|
||||
case INTERNAL_ROSE_CHAIN: {
|
||||
report_block.add_before_end(make_unique<RoseInstrReportChain>(
|
||||
report_block.add_before_end(std::make_unique<RoseInstrReportChain>(
|
||||
report.onmatch, report.topSquashDistance));
|
||||
break;
|
||||
}
|
||||
@ -663,17 +663,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
makeDedupeSom(build.rm, report, report_block);
|
||||
if (report.ekey == INVALID_EKEY) {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(make_unique<RoseInstrReportSom>(
|
||||
report_block.add_before_end(std::make_unique<RoseInstrReportSom>(
|
||||
report.onmatch, report.offsetAdjust));
|
||||
}
|
||||
} else {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrReportSomExhaust>(
|
||||
std::make_unique<RoseInstrReportSomExhaust>(
|
||||
report.onmatch, report.offsetAdjust, report.ekey));
|
||||
} else {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
std::make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
}
|
||||
}
|
||||
addLogicalSetRequired(report, build.rm, report_block);
|
||||
@ -685,17 +685,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id,
|
||||
makeDedupeSom(build.rm, report, report_block);
|
||||
if (report.ekey == INVALID_EKEY) {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(make_unique<RoseInstrReportSom>(
|
||||
report_block.add_before_end(std::make_unique<RoseInstrReportSom>(
|
||||
report.onmatch, report.offsetAdjust));
|
||||
}
|
||||
} else {
|
||||
if (!report.quiet) {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrReportSomExhaust>(
|
||||
std::make_unique<RoseInstrReportSomExhaust>(
|
||||
report.onmatch, report.offsetAdjust, report.ekey));
|
||||
} else {
|
||||
report_block.add_before_end(
|
||||
make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
std::make_unique<RoseInstrSetExhaust>(report.ekey));
|
||||
}
|
||||
}
|
||||
addLogicalSetRequired(report, build.rm, report_block);
|
||||
@ -722,11 +722,11 @@ void makeRoleReports(const RoseBuildImpl &build,
|
||||
assert(contains(leftfix_info, v));
|
||||
const left_build_info &lni = leftfix_info.at(v);
|
||||
program.add_before_end(
|
||||
make_unique<RoseInstrSomLeftfix>(lni.queue, g[v].left.lag));
|
||||
std::make_unique<RoseInstrSomLeftfix>(lni.queue, g[v].left.lag));
|
||||
report_som = true;
|
||||
} else if (g[v].som_adjust) {
|
||||
program.add_before_end(
|
||||
make_unique<RoseInstrSomAdjust>(g[v].som_adjust));
|
||||
std::make_unique<RoseInstrSomAdjust>(g[v].som_adjust));
|
||||
report_som = true;
|
||||
}
|
||||
|
||||
@ -748,7 +748,7 @@ void makeRoleSetState(const unordered_map<RoseVertex, u32> &roleStateIndices,
|
||||
if (it == end(roleStateIndices)) {
|
||||
return;
|
||||
}
|
||||
program.add_before_end(make_unique<RoseInstrSetState>(it->second));
|
||||
program.add_before_end(std::make_unique<RoseInstrSetState>(it->second));
|
||||
}
|
||||
|
||||
static
|
||||
@ -772,7 +772,7 @@ void makePushDelayedInstructions(const RoseLiteralMap &literals,
|
||||
});
|
||||
|
||||
for (const auto &ri : delay_instructions) {
|
||||
program.add_before_end(make_unique<RoseInstrPushDelayed>(ri));
|
||||
program.add_before_end(std::make_unique<RoseInstrPushDelayed>(ri));
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,10 +801,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit,
|
||||
const auto *end_inst = program.end_instruction();
|
||||
unique_ptr<RoseInstruction> ri;
|
||||
if (lit.s.any_nocase()) {
|
||||
ri = make_unique<RoseInstrCheckMedLitNocase>(lit.s.get_string(),
|
||||
ri = std::make_unique<RoseInstrCheckMedLitNocase>(lit.s.get_string(),
|
||||
end_inst);
|
||||
} else {
|
||||
ri = make_unique<RoseInstrCheckMedLit>(lit.s.get_string(),
|
||||
ri = std::make_unique<RoseInstrCheckMedLit>(lit.s.get_string(),
|
||||
end_inst);
|
||||
}
|
||||
program.add_before_end(move(ri));
|
||||
@ -820,10 +820,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit,
|
||||
const auto *end_inst = program.end_instruction();
|
||||
unique_ptr<RoseInstruction> ri;
|
||||
if (lit.s.any_nocase()) {
|
||||
ri = make_unique<RoseInstrCheckLongLitNocase>(lit.s.get_string(),
|
||||
ri = std::make_unique<RoseInstrCheckLongLitNocase>(lit.s.get_string(),
|
||||
end_inst);
|
||||
} else {
|
||||
ri = make_unique<RoseInstrCheckLongLit>(lit.s.get_string(), end_inst);
|
||||
ri = std::make_unique<RoseInstrCheckLongLit>(lit.s.get_string(), end_inst);
|
||||
}
|
||||
program.add_before_end(move(ri));
|
||||
}
|
||||
@ -840,7 +840,7 @@ void makeRoleCheckNotHandled(ProgramBuild &prog_build, RoseVertex v,
|
||||
}
|
||||
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrCheckNotHandled>(handled_key, end_inst);
|
||||
auto ri = std::make_unique<RoseInstrCheckNotHandled>(handled_key, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
}
|
||||
|
||||
@ -889,7 +889,7 @@ void makeRoleCheckBounds(const RoseBuildImpl &build, RoseVertex v,
|
||||
|
||||
const auto *end_inst = program.end_instruction();
|
||||
program.add_before_end(
|
||||
make_unique<RoseInstrCheckBounds>(min_bound, max_bound, end_inst));
|
||||
std::make_unique<RoseInstrCheckBounds>(min_bound, max_bound, end_inst));
|
||||
}
|
||||
|
||||
static
|
||||
@ -924,7 +924,7 @@ void makeRoleGroups(const RoseGraph &g, ProgramBuild &prog_build,
|
||||
return;
|
||||
}
|
||||
|
||||
program.add_before_end(make_unique<RoseInstrSetGroups>(groups));
|
||||
program.add_before_end(std::make_unique<RoseInstrSetGroups>(groups));
|
||||
}
|
||||
|
||||
static
|
||||
@ -968,7 +968,7 @@ bool makeRoleByte(const vector<LookEntry> &look, RoseProgram &program) {
|
||||
s32 checkbyte_offset = verify_s32(entry.offset);
|
||||
DEBUG_PRINTF("CHECK BYTE offset=%d\n", checkbyte_offset);
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrCheckByte>(andmask_u8, cmpmask_u8, flip,
|
||||
auto ri = std::make_unique<RoseInstrCheckByte>(andmask_u8, cmpmask_u8, flip,
|
||||
checkbyte_offset, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
return true;
|
||||
@ -1000,7 +1000,7 @@ bool makeRoleMask(const vector<LookEntry> &look, RoseProgram &program) {
|
||||
DEBUG_PRINTF("CHECK MASK and_mask=%llx cmp_mask=%llx\n",
|
||||
and_mask, cmp_mask);
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrCheckMask>(and_mask, cmp_mask, neg_mask,
|
||||
auto ri = std::make_unique<RoseInstrCheckMask>(and_mask, cmp_mask, neg_mask,
|
||||
base_offset, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
return true;
|
||||
@ -1055,7 +1055,7 @@ bool makeRoleMask32(const vector<LookEntry> &look,
|
||||
DEBUG_PRINTF("base_offset %d\n", base_offset);
|
||||
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrCheckMask32>(and_mask, cmp_mask, neg_mask,
|
||||
auto ri = std::make_unique<RoseInstrCheckMask32>(and_mask, cmp_mask, neg_mask,
|
||||
base_offset, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
return true;
|
||||
@ -1098,7 +1098,7 @@ bool makeRoleMask64(const vector<LookEntry> &look,
|
||||
DEBUG_PRINTF("base_offset %d\n", base_offset);
|
||||
|
||||
const auto *end_inst = program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrCheckMask64>(and_mask, cmp_mask, neg_mask,
|
||||
auto ri = std::make_unique<RoseInstrCheckMask64>(and_mask, cmp_mask, neg_mask,
|
||||
base_offset, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
return true;
|
||||
@ -1235,7 +1235,7 @@ makeCheckShufti16x8(u32 offset_range, u8 bucket_idx,
|
||||
copy(hi_mask.begin(), hi_mask.begin() + 16, nib_mask.begin() + 16);
|
||||
copy(bucket_select_mask.begin(), bucket_select_mask.begin() + 16,
|
||||
bucket_select_mask_16.begin());
|
||||
return make_unique<RoseInstrCheckShufti16x8>
|
||||
return std::make_unique<RoseInstrCheckShufti16x8>
|
||||
(nib_mask, bucket_select_mask_16,
|
||||
neg_mask & 0xffff, base_offset, end_inst);
|
||||
}
|
||||
@ -1255,7 +1255,7 @@ makeCheckShufti32x8(u32 offset_range, u8 bucket_idx,
|
||||
array<u8, 16> lo_mask_16;
|
||||
copy(hi_mask.begin(), hi_mask.begin() + 16, hi_mask_16.begin());
|
||||
copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_16.begin());
|
||||
return make_unique<RoseInstrCheckShufti32x8>
|
||||
return std::make_unique<RoseInstrCheckShufti32x8>
|
||||
(hi_mask_16, lo_mask_16, bucket_select_mask,
|
||||
neg_mask, base_offset, end_inst);
|
||||
}
|
||||
@ -1277,7 +1277,7 @@ makeCheckShufti16x16(u32 offset_range, u8 bucket_idx,
|
||||
bucket_select_mask_32.begin());
|
||||
copy(bucket_select_mask_hi.begin(), bucket_select_mask_hi.begin() + 16,
|
||||
bucket_select_mask_32.begin() + 16);
|
||||
return make_unique<RoseInstrCheckShufti16x16>
|
||||
return std::make_unique<RoseInstrCheckShufti16x16>
|
||||
(hi_mask, lo_mask, bucket_select_mask_32,
|
||||
neg_mask & 0xffff, base_offset, end_inst);
|
||||
}
|
||||
@ -1294,7 +1294,7 @@ makeCheckShufti32x16(u32 offset_range, u8 bucket_idx,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return make_unique<RoseInstrCheckShufti32x16>
|
||||
return std::make_unique<RoseInstrCheckShufti32x16>
|
||||
(hi_mask, lo_mask, bucket_select_mask_hi,
|
||||
bucket_select_mask_lo, neg_mask, base_offset, end_inst);
|
||||
}
|
||||
@ -1321,7 +1321,7 @@ makeCheckShufti64x8(u32 offset_range, u8 bucket_idx,
|
||||
copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 32);
|
||||
copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 48);
|
||||
|
||||
return make_unique<RoseInstrCheckShufti64x8>
|
||||
return std::make_unique<RoseInstrCheckShufti64x8>
|
||||
(hi_mask_64, lo_mask_64, bucket_select_mask,
|
||||
neg_mask, base_offset, end_inst);
|
||||
}
|
||||
@ -1361,7 +1361,7 @@ makeCheckShufti64x16(u32 offset_range, u8 bucket_idx,
|
||||
copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 32);
|
||||
copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 48);
|
||||
|
||||
return make_unique<RoseInstrCheckShufti64x16>
|
||||
return std::make_unique<RoseInstrCheckShufti64x16>
|
||||
(hi_mask_1, hi_mask_2, lo_mask_1, lo_mask_2, bucket_select_mask_hi,
|
||||
bucket_select_mask_lo, neg_mask, base_offset, end_inst);
|
||||
}
|
||||
@ -1486,7 +1486,7 @@ void makeLookaroundInstruction(const vector<LookEntry> &look,
|
||||
if (look.size() == 1) {
|
||||
s8 offset = look.begin()->offset;
|
||||
const CharReach &reach = look.begin()->reach;
|
||||
auto ri = make_unique<RoseInstrCheckSingleLookaround>(offset, reach,
|
||||
auto ri = std::make_unique<RoseInstrCheckSingleLookaround>(offset, reach,
|
||||
program.end_instruction());
|
||||
program.add_before_end(move(ri));
|
||||
return;
|
||||
@ -1508,7 +1508,7 @@ void makeLookaroundInstruction(const vector<LookEntry> &look,
|
||||
return;
|
||||
}
|
||||
|
||||
auto ri = make_unique<RoseInstrCheckLookaround>(look,
|
||||
auto ri = std::make_unique<RoseInstrCheckLookaround>(look,
|
||||
program.end_instruction());
|
||||
program.add_before_end(move(ri));
|
||||
}
|
||||
@ -1584,7 +1584,7 @@ void makeCheckLitEarlyInstruction(const RoseBuildImpl &build, u32 lit_id,
|
||||
|
||||
DEBUG_PRINTF("adding lit early check, min_offset=%u\n", min_offset);
|
||||
const auto *end = prog.end_instruction();
|
||||
prog.add_before_end(make_unique<RoseInstrCheckLitEarly>(min_offset, end));
|
||||
prog.add_before_end(std::make_unique<RoseInstrCheckLitEarly>(min_offset, end));
|
||||
}
|
||||
|
||||
static
|
||||
@ -1595,7 +1595,7 @@ void makeGroupCheckInstruction(const RoseBuildImpl &build, u32 lit_id,
|
||||
if (!info.group_mask) {
|
||||
return;
|
||||
}
|
||||
prog.add_before_end(make_unique<RoseInstrCheckGroups>(info.group_mask));
|
||||
prog.add_before_end(std::make_unique<RoseInstrCheckGroups>(info.group_mask));
|
||||
}
|
||||
|
||||
static
|
||||
@ -1762,7 +1762,7 @@ bool makeRoleMultipathShufti(const vector<vector<LookEntry>> &multi_look,
|
||||
copy(begin(lo_mask), begin(lo_mask) + 16, nib_mask.begin());
|
||||
copy(begin(hi_mask), begin(hi_mask) + 16, nib_mask.begin() + 16);
|
||||
|
||||
auto ri = make_unique<RoseInstrCheckMultipathShufti16x8>
|
||||
auto ri = std::make_unique<RoseInstrCheckMultipathShufti16x8>
|
||||
(nib_mask, bucket_select_lo, data_select_mask, hi_bits_mask,
|
||||
lo_bits_mask, neg_mask, base_offset, last_start, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
@ -1771,20 +1771,20 @@ bool makeRoleMultipathShufti(const vector<vector<LookEntry>> &multi_look,
|
||||
assert(!(hi_bits_mask & ~0xffffffffULL));
|
||||
assert(!(lo_bits_mask & ~0xffffffffULL));
|
||||
if (bit_index <= 8) {
|
||||
auto ri = make_unique<RoseInstrCheckMultipathShufti32x8>
|
||||
auto ri = std::make_unique<RoseInstrCheckMultipathShufti32x8>
|
||||
(hi_mask, lo_mask, bucket_select_lo, data_select_mask,
|
||||
hi_bits_mask, lo_bits_mask, neg_mask, base_offset,
|
||||
last_start, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
} else {
|
||||
auto ri = make_unique<RoseInstrCheckMultipathShufti32x16>
|
||||
auto ri = std::make_unique<RoseInstrCheckMultipathShufti32x16>
|
||||
(hi_mask, lo_mask, bucket_select_hi, bucket_select_lo,
|
||||
data_select_mask, hi_bits_mask, lo_bits_mask, neg_mask,
|
||||
base_offset, last_start, end_inst);
|
||||
program.add_before_end(move(ri));
|
||||
}
|
||||
} else {
|
||||
auto ri = make_unique<RoseInstrCheckMultipathShufti64>
|
||||
auto ri = std::make_unique<RoseInstrCheckMultipathShufti64>
|
||||
(hi_mask, lo_mask, bucket_select_lo, data_select_mask,
|
||||
hi_bits_mask, lo_bits_mask, neg_mask, base_offset,
|
||||
last_start, end_inst);
|
||||
@ -1856,7 +1856,7 @@ void makeRoleMultipathLookaround(const vector<vector<LookEntry>> &multi_look,
|
||||
ordered_look.emplace_back(multi_entry);
|
||||
}
|
||||
|
||||
auto ri = make_unique<RoseInstrMultipathLookaround>(move(ordered_look),
|
||||
auto ri = std::make_unique<RoseInstrMultipathLookaround>(move(ordered_look),
|
||||
last_start, start_mask,
|
||||
program.end_instruction());
|
||||
program.add_before_end(move(ri));
|
||||
@ -1932,7 +1932,7 @@ void makeRoleSuffix(const RoseBuildImpl &build,
|
||||
event = MQE_TOP;
|
||||
}
|
||||
|
||||
prog.add_before_end(make_unique<RoseInstrTriggerSuffix>(queue, event));
|
||||
prog.add_before_end(std::make_unique<RoseInstrTriggerSuffix>(queue, event));
|
||||
}
|
||||
|
||||
static
|
||||
@ -1945,7 +1945,7 @@ void addInfixTriggerInstructions(vector<TriggerInfo> triggers,
|
||||
});
|
||||
for (const auto &ti : triggers) {
|
||||
prog.add_before_end(
|
||||
make_unique<RoseInstrTriggerInfix>(ti.cancel, ti.queue, ti.event));
|
||||
std::make_unique<RoseInstrTriggerInfix>(ti.cancel, ti.queue, ti.event));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2039,7 +2039,7 @@ static
|
||||
void addCheckOnlyEodInstruction(RoseProgram &prog) {
|
||||
DEBUG_PRINTF("only at eod\n");
|
||||
const auto *end_inst = prog.end_instruction();
|
||||
prog.add_before_end(make_unique<RoseInstrCheckOnlyEod>(end_inst));
|
||||
prog.add_before_end(std::make_unique<RoseInstrCheckOnlyEod>(end_inst));
|
||||
}
|
||||
|
||||
static
|
||||
@ -2164,7 +2164,7 @@ void makeGroupSquashInstruction(const RoseBuildImpl &build, u32 lit_id,
|
||||
DEBUG_PRINTF("squashes 0x%llx\n", info.group_mask);
|
||||
assert(info.group_mask);
|
||||
/* Note: group_mask is negated. */
|
||||
prog.add_before_end(make_unique<RoseInstrSquashGroups>(~info.group_mask));
|
||||
prog.add_before_end(std::make_unique<RoseInstrSquashGroups>(~info.group_mask));
|
||||
}
|
||||
|
||||
namespace {
|
||||
@ -2209,7 +2209,7 @@ RoseProgram assembleProgramBlocks(vector<RoseProgram> &&blocks_in) {
|
||||
* only set if a state has been. */
|
||||
if (!prog.empty() && reads_work_done_flag(block)) {
|
||||
RoseProgram clear_block;
|
||||
clear_block.add_before_end(make_unique<RoseInstrClearWorkDone>());
|
||||
clear_block.add_before_end(std::make_unique<RoseInstrClearWorkDone>());
|
||||
prog.add_block(move(clear_block));
|
||||
}
|
||||
|
||||
@ -2369,7 +2369,7 @@ void makeCatchupMpv(const ReportManager &rm, bool needs_mpv_catchup,
|
||||
return;
|
||||
}
|
||||
|
||||
program.add_before_end(make_unique<RoseInstrCatchUpMpv>());
|
||||
program.add_before_end(std::make_unique<RoseInstrCatchUpMpv>());
|
||||
}
|
||||
|
||||
RoseProgram makeReportProgram(const RoseBuildImpl &build,
|
||||
@ -2402,7 +2402,7 @@ RoseProgram makeBoundaryProgram(const RoseBuildImpl &build,
|
||||
void addIncludedJumpProgram(RoseProgram &program, u32 child_offset,
|
||||
u8 squash) {
|
||||
RoseProgram block;
|
||||
block.add_before_end(make_unique<RoseInstrIncludedJump>(child_offset,
|
||||
block.add_before_end(std::make_unique<RoseInstrIncludedJump>(child_offset,
|
||||
squash));
|
||||
program.add_block(move(block));
|
||||
}
|
||||
@ -2413,7 +2413,7 @@ void addPredBlockSingle(u32 pred_state, RoseProgram &pred_block,
|
||||
// Prepend an instruction to check the pred state is on.
|
||||
const auto *end_inst = pred_block.end_instruction();
|
||||
pred_block.insert(begin(pred_block),
|
||||
make_unique<RoseInstrCheckState>(pred_state, end_inst));
|
||||
std::make_unique<RoseInstrCheckState>(pred_state, end_inst));
|
||||
program.add_block(move(pred_block));
|
||||
}
|
||||
|
||||
@ -2428,7 +2428,7 @@ void addPredBlocksAny(map<u32, RoseProgram> &pred_blocks, u32 num_states,
|
||||
}
|
||||
|
||||
const RoseInstruction *end_inst = sparse_program.end_instruction();
|
||||
auto ri = make_unique<RoseInstrSparseIterAny>(num_states, keys, end_inst);
|
||||
auto ri = std::make_unique<RoseInstrSparseIterAny>(num_states, keys, end_inst);
|
||||
sparse_program.add_before_end(move(ri));
|
||||
|
||||
RoseProgram &block = pred_blocks.begin()->second;
|
||||
@ -2451,14 +2451,14 @@ void addPredBlocksMulti(map<u32, RoseProgram> &pred_blocks,
|
||||
vector<pair<u32, const RoseInstruction *>> jump_table;
|
||||
|
||||
// BEGIN instruction.
|
||||
auto ri_begin = make_unique<RoseInstrSparseIterBegin>(num_states, end_inst);
|
||||
auto ri_begin = std::make_unique<RoseInstrSparseIterBegin>(num_states, end_inst);
|
||||
RoseInstrSparseIterBegin *begin_inst = ri_begin.get();
|
||||
sparse_program.add_before_end(move(ri_begin));
|
||||
|
||||
// NEXT instructions, one per pred program.
|
||||
u32 prev_key = pred_blocks.begin()->first;
|
||||
for (auto it = next(begin(pred_blocks)); it != end(pred_blocks); ++it) {
|
||||
auto ri = make_unique<RoseInstrSparseIterNext>(prev_key, begin_inst,
|
||||
auto ri = std::make_unique<RoseInstrSparseIterNext>(prev_key, begin_inst,
|
||||
end_inst);
|
||||
sparse_program.add_before_end(move(ri));
|
||||
prev_key = it->first;
|
||||
@ -2539,7 +2539,7 @@ void applyFinalSpecialisation(RoseProgram &program) {
|
||||
auto it = next(program.rbegin());
|
||||
if (auto *ri = dynamic_cast<const RoseInstrReport *>(it->get())) {
|
||||
DEBUG_PRINTF("replacing REPORT with FINAL_REPORT\n");
|
||||
program.replace(it, make_unique<RoseInstrFinalReport>(
|
||||
program.replace(it, std::make_unique<RoseInstrFinalReport>(
|
||||
ri->onmatch, ri->offset_adjust));
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "rose_program.h"
|
||||
#include "util/bytecode_ptr.h"
|
||||
#include "util/hash.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "nfagraph/ng_width.h"
|
||||
#include "util/container.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -93,7 +92,7 @@ private:
|
||||
|
||||
unique_ptr<RoseInGraph> cloneRoseGraph(const RoseInGraph &ig) {
|
||||
assert(hasCorrectlyNumberedVertices(ig));
|
||||
unique_ptr<RoseInGraph> out = make_unique<RoseInGraph>();
|
||||
unique_ptr<RoseInGraph> out = std::make_unique<RoseInGraph>();
|
||||
|
||||
unordered_map<const NGHolder *, shared_ptr<NGHolder>> graph_map;
|
||||
unordered_map<const raw_som_dfa *, shared_ptr<raw_som_dfa>> haig_map;
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include "util/compare.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/container.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/ue2_graph.h"
|
||||
#include "util/ue2string.h"
|
||||
#include "util/verify_types.h"
|
||||
@ -862,7 +861,7 @@ bytecode_ptr<NFA> prepEngine(raw_dfa &rdfa, u32 roseQuality,
|
||||
unique_ptr<SmallWriteBuild> makeSmallWriteBuilder(size_t num_patterns,
|
||||
const ReportManager &rm,
|
||||
const CompileContext &cc) {
|
||||
return ue2::make_unique<SmallWriteBuildImpl>(num_patterns, rm, cc);
|
||||
return std::make_unique<SmallWriteBuildImpl>(num_patterns, rm, cc);
|
||||
}
|
||||
|
||||
bytecode_ptr<SmallWriteEngine> SmallWriteBuildImpl::build(u32 roseQuality) {
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "nfagraph/ng_region.h"
|
||||
#include "util/charreach.h"
|
||||
#include "util/hash.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/dump_charclass.h"
|
||||
#include "util/verify_types.h"
|
||||
|
||||
@ -105,7 +104,7 @@ const SlotCacheEntry *SlotCache::find(const NGHolder &prefix,
|
||||
}
|
||||
|
||||
SomSlotManager::SomSlotManager(u8 p)
|
||||
: nextSomSlot(0), cache(ue2::make_unique<SlotCache>()), historyRequired(0),
|
||||
: nextSomSlot(0), cache(std::make_unique<SlotCache>()), historyRequired(0),
|
||||
precision(p) {}
|
||||
|
||||
SomSlotManager::~SomSlotManager() { }
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "clique.h"
|
||||
#include "container.h"
|
||||
#include "graph_range.h"
|
||||
#include "make_unique.h"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2017, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Intel Corporation nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef UTIL_MAKE_UNIQUE_H
|
||||
#define UTIL_MAKE_UNIQUE_H
|
||||
|
||||
#if (defined(_WIN32) || defined(_WIN64)) && (_MSC_VER > 1700)
|
||||
// VC++ 2013 onwards has make_unique in the STL
|
||||
#define USE_STD
|
||||
#include <memory>
|
||||
#else
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
#endif
|
||||
|
||||
namespace ue2 {
|
||||
#if defined(USE_STD)
|
||||
using std::make_unique;
|
||||
#else
|
||||
using boost::make_unique;
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef USE_STD
|
||||
#endif // UTIL_MAKE_UNIQUE_H
|
@ -38,8 +38,6 @@
|
||||
|
||||
#include "chimera/ch_database.h"
|
||||
|
||||
#include "util/make_unique.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
EngineCHContext::EngineCHContext(const ch_database_t *db) {
|
||||
@ -105,7 +103,7 @@ EngineChimera::~EngineChimera() {
|
||||
}
|
||||
|
||||
unique_ptr<EngineContext> EngineChimera::makeContext() const {
|
||||
return ue2::make_unique<EngineCHContext>(db);
|
||||
return std::make_unique<EngineCHContext>(db);
|
||||
}
|
||||
|
||||
void EngineChimera::scan(const char *data, unsigned int len, unsigned int id,
|
||||
@ -333,5 +331,5 @@ buildEngineChimera(const ExpressionMap &expressions, const string &name,
|
||||
cs.compileSecs = compileSecs;
|
||||
cs.peakMemorySize = peakMemorySize;
|
||||
|
||||
return ue2::make_unique<EngineChimera>(db, move(cs));
|
||||
return std::make_unique<EngineChimera>(db, move(cs));
|
||||
}
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "hs_internal.h"
|
||||
#include "hs_runtime.h"
|
||||
#include "util/database_util.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@ -126,7 +125,7 @@ EngineHyperscan::~EngineHyperscan() {
|
||||
}
|
||||
|
||||
unique_ptr<EngineContext> EngineHyperscan::makeContext() const {
|
||||
return ue2::make_unique<EngineHSContext>(db);
|
||||
return std::make_unique<EngineHSContext>(db);
|
||||
}
|
||||
|
||||
void EngineHyperscan::scan(const char *data, unsigned int len, unsigned int id,
|
||||
@ -166,7 +165,7 @@ void EngineHyperscan::scan_vectored(const char *const *data,
|
||||
unique_ptr<EngineStream> EngineHyperscan::streamOpen(EngineContext &ectx,
|
||||
unsigned streamId) const {
|
||||
EngineHSContext &ctx = static_cast<EngineHSContext &>(ectx);
|
||||
auto stream = ue2::make_unique<EngineHSStream>();
|
||||
auto stream = std::make_unique<EngineHSStream>();
|
||||
stream->ctx = &ctx;
|
||||
|
||||
hs_open_stream(db, 0, &stream->id);
|
||||
@ -549,5 +548,5 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
|
||||
cs.compileSecs = compileSecs;
|
||||
cs.peakMemorySize = peakMemorySize;
|
||||
|
||||
return ue2::make_unique<EngineHyperscan>(db, std::move(cs));
|
||||
return std::make_unique<EngineHyperscan>(db, std::move(cs));
|
||||
}
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "sqldb.h"
|
||||
#include "timer.h"
|
||||
|
||||
#include "util/make_unique.h"
|
||||
#include "util/unicode_def.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -105,7 +104,7 @@ EnginePCRE::~EnginePCRE() {
|
||||
}
|
||||
|
||||
unique_ptr<EngineContext> EnginePCRE::makeContext() const {
|
||||
return ue2::make_unique<EnginePCREContext>(capture_cnt);
|
||||
return std::make_unique<EnginePCREContext>(capture_cnt);
|
||||
}
|
||||
|
||||
void EnginePCRE::scan(const char *data, unsigned int len, unsigned int id,
|
||||
@ -322,7 +321,7 @@ buildEnginePcre(const ExpressionMap &expressions, const string &name,
|
||||
for (const auto &m : expressions) {
|
||||
string expr(m.second);
|
||||
unsigned int flags = 0;
|
||||
auto pcreDB = ue2::make_unique<PcreDB>();
|
||||
auto pcreDB = std::make_unique<PcreDB>();
|
||||
if (!decodeExprPCRE(expr, &flags, *pcreDB)) {
|
||||
printf("Error parsing PCRE: %s (id %u)\n", m.second.c_str(),
|
||||
m.first);
|
||||
@ -406,5 +405,5 @@ buildEnginePcre(const ExpressionMap &expressions, const string &name,
|
||||
cs.compileSecs = compileSecs;
|
||||
cs.peakMemorySize = peakMemorySize;
|
||||
|
||||
return ue2::make_unique<EnginePCRE>(move(dbs), move(cs), capture_cnt);
|
||||
return std::make_unique<EnginePCRE>(move(dbs), move(cs), capture_cnt);
|
||||
}
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "grey.h"
|
||||
#include "hs.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <clocale>
|
||||
@ -979,7 +978,7 @@ unique_ptr<ThreadContext> makeThreadContext(const Engine &db,
|
||||
}
|
||||
assert(fn);
|
||||
|
||||
return ue2::make_unique<ThreadContext>(id, db, sync_barrier, fn, blocks);
|
||||
return std::make_unique<ThreadContext>(id, db, sync_barrier, fn, blocks);
|
||||
}
|
||||
|
||||
/** Run the given benchmark. */
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "expressions.h"
|
||||
#include "string_util.h"
|
||||
#include "util/expression_path.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include "grey.h"
|
||||
#include "hs_compile.h"
|
||||
@ -664,7 +663,7 @@ int HS_CDECL main(int argc, char **argv) {
|
||||
num_of_threads = max(1u, std::thread::hardware_concurrency());
|
||||
|
||||
#if !defined(RELEASE_BUILD)
|
||||
g_grey = make_unique<Grey>();
|
||||
g_grey = std::make_unique<Grey>();
|
||||
#endif
|
||||
processArgs(argc, argv, g_grey);
|
||||
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "parser/unsupported.h"
|
||||
#include "parser/logical_combination.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/report_manager.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -131,7 +130,7 @@ void CNGInfo::compile() {
|
||||
|
||||
try {
|
||||
if (combination) {
|
||||
auto pl = ue2::make_unique<ParsedLogical>();
|
||||
auto pl = std::make_unique<ParsedLogical>();
|
||||
pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL);
|
||||
pl->logicalKeyRenumber();
|
||||
cng = make_unique<CompiledNG>(move(pl));
|
||||
@ -148,7 +147,7 @@ void CNGInfo::compile() {
|
||||
// original expression starts with (*UTF8)
|
||||
utf8 |= pe.expr.utf8;
|
||||
|
||||
auto rm = ue2::make_unique<ReportManager>(cc.grey);
|
||||
auto rm = std::make_unique<ReportManager>(cc.grey);
|
||||
|
||||
// Expressions containing zero-width assertions and other extended pcre
|
||||
// types aren't supported yet. This call will throw a ParseError
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "parser/control_verbs.h"
|
||||
#include "parser/Parser.h"
|
||||
#include "parser/parse_error.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/string_util.h"
|
||||
#include "util/unicode_def.h"
|
||||
#include "util/unordered.h"
|
||||
@ -331,7 +330,7 @@ GroundTruth::compile(unsigned id, bool no_callouts) {
|
||||
int errloc = 0;
|
||||
int errcode = 0;
|
||||
|
||||
unique_ptr<CompiledPcre> compiled = make_unique<CompiledPcre>();
|
||||
unique_ptr<CompiledPcre> compiled = std::make_unique<CompiledPcre>();
|
||||
compiled->utf8 = flags & PCRE_UTF8;
|
||||
compiled->highlander = highlander;
|
||||
compiled->prefilter = prefilter;
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "crc32.h"
|
||||
#include "hs.h"
|
||||
#include "hs_internal.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include "scratch.h"
|
||||
#include "nfa/nfa_api_queue.h"
|
||||
@ -948,7 +947,7 @@ compileHyperscan(vector<const char *> &patterns, vector<unsigned> &flags,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ue2::make_unique<HyperscanDB>(db, idsvec.begin(), idsvec.end());
|
||||
return std::make_unique<HyperscanDB>(db, idsvec.begin(), idsvec.end());
|
||||
}
|
||||
|
||||
#ifdef HS_HYBRID
|
||||
@ -970,7 +969,7 @@ compileHybrid(vector<const char *> &patterns,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ue2::make_unique<HybridDB>(db, idsvec.begin(), idsvec.end());
|
||||
return std::make_unique<HybridDB>(db, idsvec.begin(), idsvec.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "parser/utf8_validate.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/container.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@ -1077,7 +1076,7 @@ void addCorporaToQueue(ostream &out, BoundedQueue<TestUnit> &testq, unsigned id,
|
||||
|
||||
size_t corpus_id = 0;
|
||||
for (const Corpus &corpus : c) {
|
||||
tests.push_back(ue2::make_unique<TestUnit>(id, corpus_id, corpus, cpcre,
|
||||
tests.push_back(std::make_unique<TestUnit>(id, corpus_id, corpus, cpcre,
|
||||
cngi, ue2, multi, utf8,
|
||||
highlander, prefilter, som));
|
||||
corpus_id++;
|
||||
@ -1435,7 +1434,7 @@ unique_ptr<CorpusGenUnit> makeCorpusGenUnit(unsigned id, TestSummary &summary,
|
||||
// Caller may already have set the UTF-8 property (in multi cases)
|
||||
utf8 |= cpcre ? cpcre->utf8 : cngi->utf8;
|
||||
|
||||
return ue2::make_unique<CorpusGenUnit>(move(cngi), move(cpcre), ue2, id,
|
||||
return std::make_unique<CorpusGenUnit>(move(cngi), move(cpcre), ue2, id,
|
||||
multi, utf8);
|
||||
}
|
||||
|
||||
@ -1824,7 +1823,7 @@ static
|
||||
unique_ptr<CorporaSource> buildCorpora(const vector<string> &corporaFiles,
|
||||
const ExpressionMap &exprMap) {
|
||||
if (!corporaFiles.empty()) {
|
||||
auto c = ue2::make_unique<FileCorpora>();
|
||||
auto c = std::make_unique<FileCorpora>();
|
||||
for (const auto &file : corporaFiles) {
|
||||
if (!c->readFile(file)) {
|
||||
cout << "Error reading corpora from file: " << file << endl;
|
||||
@ -1833,7 +1832,7 @@ unique_ptr<CorporaSource> buildCorpora(const vector<string> &corporaFiles,
|
||||
}
|
||||
return move(c); /* move allows unique_ptr<CorporaSource> conversion */
|
||||
} else {
|
||||
auto c = ue2::make_unique<NfaGeneratedCorpora>(
|
||||
auto c = std::make_unique<NfaGeneratedCorpora>(
|
||||
exprMap, corpus_gen_prop, force_utf8, force_prefilter);
|
||||
return move(c);
|
||||
}
|
||||
@ -1886,7 +1885,7 @@ bool runTests(CorporaSource &corpora_source, const ExpressionMap &exprMap,
|
||||
// Start scanning threads.
|
||||
vector<unique_ptr<ScanThread>> scanners;
|
||||
for (size_t i = 0; i < numScannerThreads; i++) {
|
||||
auto s = ue2::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
|
||||
auto s = std::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
|
||||
s->start();
|
||||
scanners.push_back(move(s));
|
||||
}
|
||||
@ -1989,7 +1988,7 @@ int HS_CDECL main(int argc, char *argv[]) {
|
||||
|
||||
// If we're saving corpora out, truncate the output file.
|
||||
if (saveCorpora) {
|
||||
corporaOut = ue2::make_unique<CorpusWriter>(saveCorporaFile);
|
||||
corporaOut = std::make_unique<CorpusWriter>(saveCorporaFile);
|
||||
}
|
||||
|
||||
GroundTruth::global_prep();
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "ue2common.h"
|
||||
#include "rose/rose_build_scatter.h"
|
||||
#include "util/compile_error.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/multibit.h"
|
||||
#include "util/multibit_build.h"
|
||||
|
||||
@ -49,10 +48,10 @@ class mmbit_holder {
|
||||
public:
|
||||
mmbit_holder() {}
|
||||
explicit mmbit_holder(u32 num_bits, u32 excess = 0)
|
||||
: data(ue2::make_unique<u8[]>(mmbit_size(num_bits) + 7 + excess)) {}
|
||||
: data(std::make_unique<u8[]>(mmbit_size(num_bits) + 7 + excess)) {}
|
||||
void init(u32 num_bits) {
|
||||
assert(!data);
|
||||
data = ue2::make_unique<u8[]>(mmbit_size(num_bits) + 7);
|
||||
data = std::make_unique<u8[]>(mmbit_size(num_bits) + 7);
|
||||
}
|
||||
operator u8 *() {
|
||||
assert(data);
|
||||
@ -727,7 +726,7 @@ TEST_P(MultiBitTest, InitRangeChunked) {
|
||||
}
|
||||
|
||||
static
|
||||
void apply(const scatter_plan_raw &sp, u8 *out) {
|
||||
void applyMB(const scatter_plan_raw &sp, u8 *out) {
|
||||
for (const auto &e : sp.p_u64a) {
|
||||
memcpy(out + e.offset, &e.val, sizeof(e.val));
|
||||
}
|
||||
@ -761,7 +760,7 @@ TEST_P(MultiBitTest, InitRangePlanChunked) {
|
||||
scatter_plan_raw sp;
|
||||
mmbBuildInitRangePlan(test_size, chunk_begin, chunk_end, &sp);
|
||||
memset(ba, 0xaa, mmbit_size(test_size));
|
||||
apply(sp, ba);
|
||||
applyMB(sp, ba);
|
||||
|
||||
// First bit set should be chunk_begin.
|
||||
ASSERT_EQ(chunk_begin, mmbit_iterate(ba, test_size, MMB_INVALID));
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/compile_error.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/multibit.h"
|
||||
#include "util/multibit_build.h"
|
||||
#include "util/multibit_compress.h"
|
||||
@ -86,10 +85,10 @@ class mmbit_holder {
|
||||
public:
|
||||
mmbit_holder() {}
|
||||
explicit mmbit_holder(u32 num_bits, u32 excess = 0)
|
||||
: data(ue2::make_unique<u8[]>(mmbit_size(num_bits) + 7 + excess)) {}
|
||||
: data(std::make_unique<u8[]>(mmbit_size(num_bits) + 7 + excess)) {}
|
||||
void init(u32 num_bits) {
|
||||
assert(!data);
|
||||
data = ue2::make_unique<u8[]>(mmbit_size(num_bits) + 7);
|
||||
data = std::make_unique<u8[]>(mmbit_size(num_bits) + 7);
|
||||
}
|
||||
operator u8 *() {
|
||||
assert(data);
|
||||
@ -108,10 +107,10 @@ class comp_holder {
|
||||
public:
|
||||
comp_holder() {}
|
||||
explicit comp_holder(u32 length)
|
||||
: data(ue2::make_unique<u8[]>(length + 7)) {}
|
||||
: data(std::make_unique<u8[]>(length + 7)) {}
|
||||
void init(u32 length) {
|
||||
assert(!data);
|
||||
data = ue2::make_unique<u8[]>(length + 7);
|
||||
data = std::make_unique<u8[]>(length + 7);
|
||||
}
|
||||
operator u8 *() {
|
||||
assert(data);
|
||||
|
@ -30,7 +30,6 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "util/pack_bits.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "ue2common.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -92,7 +91,7 @@ void test_pack_and_unpack(const vector<T> &v, const vector<u32> &bits) {
|
||||
|
||||
// Temporary char array to pack into.
|
||||
const size_t mem_size = packed_size(bits);
|
||||
unique_ptr<char[]> mem = ue2::make_unique<char[]>(mem_size);
|
||||
unique_ptr<char[]> mem = std::make_unique<char[]>(mem_size);
|
||||
|
||||
pack_bits<T>(&mem[0], &v[0], &bits[0], elements);
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "nfa/repeat.h"
|
||||
#include "nfa/repeatcompile.h"
|
||||
#include "util/depth.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
@ -431,7 +430,7 @@ TEST_P(RepeatTest, Pack) {
|
||||
// We should be able to pack and then unpack the control block at any
|
||||
// offset up to repeatMin and get a match at both the min and max repeats.
|
||||
|
||||
unique_ptr<char[]> packed = ue2::make_unique<char[]>(info.packedCtrlSize);
|
||||
unique_ptr<char[]> packed = std::make_unique<char[]>(info.packedCtrlSize);
|
||||
|
||||
for (u32 i = 0; i < info.repeatMax; i++) {
|
||||
SCOPED_TRACE(testing::Message() << "i=" << i);
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "util/boundary_reports.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "smallwrite/smallwrite_build.h"
|
||||
#include "som/slot_manager.h"
|
||||
|
||||
@ -52,7 +51,7 @@ using namespace ue2;
|
||||
|
||||
static
|
||||
std::unique_ptr<NGHolder> makeSuffixGraph(ReportID report) {
|
||||
auto h = ue2::make_unique<NGHolder>(NFA_SUFFIX);
|
||||
auto h = std::make_unique<NGHolder>(NFA_SUFFIX);
|
||||
NGHolder &g = *h;
|
||||
|
||||
NFAVertex v = add_vertex(g);
|
||||
|
@ -894,6 +894,7 @@ TEST(DoubleShufti, ExecMatchMixed3) {
|
||||
for (size_t i = 0; i < 400; i++) {
|
||||
t2[len - i] = 'x';
|
||||
t2[len - i + 1] = 'y';
|
||||
DEBUG_PRINTF("i = %ld\n", i);
|
||||
const u8 *rv = shuftiDoubleExec(lo1, hi1, lo2, hi2,
|
||||
(u8 *)t2, (u8 *)t2 + len);
|
||||
|
||||
@ -1106,6 +1107,7 @@ TEST(ReverseShufti, ExecMatch6) {
|
||||
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
t1[i] = 'a';
|
||||
DEBUG_PRINTF("i=%ld\n", i);
|
||||
const u8 *rv = rshuftiExec(lo, hi, (u8 *)t1, (u8 *)t1 + len);
|
||||
|
||||
ASSERT_EQ((const u8 *)t1 + i, rv);
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "util/arch.h"
|
||||
#include "util/bytecode_ptr.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/simd_utils.h"
|
||||
|
||||
using namespace std;
|
||||
@ -522,7 +521,7 @@ TYPED_TEST(SimdUtilsTest, loadu) {
|
||||
const TypeParam ones = simd_ones();
|
||||
|
||||
const size_t mem_len = sizeof(ones) * 2;
|
||||
unique_ptr<char[]> mem_array = ue2::make_unique<char[]>(mem_len);
|
||||
unique_ptr<char[]> mem_array = std::make_unique<char[]>(mem_len);
|
||||
char *mem = mem_array.get();
|
||||
|
||||
for (size_t offset = 1; offset < sizeof(ones); offset++) {
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "cross_compile.h"
|
||||
#include "src/ue2common.h"
|
||||
#include "src/hs_compile.h"
|
||||
#include "src/util/make_unique.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@ -74,7 +73,7 @@ unique_ptr<hs_platform_info> xcompileReadMode(const char *s) {
|
||||
return nullptr;
|
||||
} else {
|
||||
DEBUG_PRINTF("cpu_features %llx\n", rv.cpu_features);
|
||||
return ue2::make_unique<hs_platform_info>(rv);
|
||||
return std::make_unique<hs_platform_info>(rv);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "ue2common.h"
|
||||
#include "util/container.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/ue2string.h"
|
||||
#include "util/unicode_def.h"
|
||||
#include "util/unicode_set.h"
|
||||
@ -141,7 +140,7 @@ void findPaths(const NGHolder &g, CorpusProperties &cProps,
|
||||
const size_t MAX_OPEN = min((size_t)1000, corpusLimit * 10);
|
||||
|
||||
vector<unique_ptr<VertexPath>> open;
|
||||
open.push_back(ue2::make_unique<VertexPath>(1, g.start));
|
||||
open.push_back(std::make_unique<VertexPath>(1, g.start));
|
||||
|
||||
unordered_set<NFAVertex> one_way_in;
|
||||
for (const auto &v : vertices_range(g)) {
|
||||
@ -200,7 +199,7 @@ void findPaths(const NGHolder &g, CorpusProperties &cProps,
|
||||
if (boost::next(ai) == ae) {
|
||||
new_path = std::move(p);
|
||||
} else {
|
||||
new_path = make_unique<VertexPath>(*p);
|
||||
new_path = std::make_unique<VertexPath>(*p);
|
||||
}
|
||||
|
||||
new_path->push_back(v);
|
||||
@ -714,8 +713,8 @@ unique_ptr<CorpusGenerator> makeCorpusGenerator(const NGHolder &graph,
|
||||
const ExpressionInfo &expr,
|
||||
CorpusProperties &props) {
|
||||
if (expr.utf8) {
|
||||
return ue2::make_unique<CorpusGeneratorUtf8>(graph, expr, props);
|
||||
return std::make_unique<CorpusGeneratorUtf8>(graph, expr, props);
|
||||
} else {
|
||||
return ue2::make_unique<CorpusGeneratorImpl>(graph, expr, props);
|
||||
return std::make_unique<CorpusGeneratorImpl>(graph, expr, props);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user