]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
use STL make_unique, remove wrapper header, breaks C++17 compilation
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Fri, 23 Jul 2021 08:54:53 +0000 (11:54 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 12 Oct 2021 08:51:34 +0000 (11:51 +0300)
62 files changed:
chimera/ch_compile.cpp
src/fdr/fdr_compile.cpp
src/fdr/fdr_engine_description.cpp
src/fdr/teddy_compile.cpp
src/fdr/teddy_engine_description.cpp
src/hwlm/hwlm_build.cpp
src/nfa/castlecompile.cpp
src/nfa/goughcompile.cpp
src/nfa/mcclellancompile.cpp
src/nfa/mcsheng_compile.cpp
src/nfa/rdfa_merge.cpp
src/nfa/shengcompile.cpp
src/nfagraph/ng.cpp
src/nfagraph/ng_builder.cpp
src/nfagraph/ng_calc_components.cpp
src/nfagraph/ng_equivalence.cpp
src/nfagraph/ng_haig.cpp
src/nfagraph/ng_is_equal.cpp
src/nfagraph/ng_literal_decorated.cpp
src/nfagraph/ng_mcclellan.cpp
src/nfagraph/ng_som.cpp
src/nfagraph/ng_util.cpp
src/nfagraph/ng_violet.cpp
src/parser/ComponentClass.cpp
src/parser/ComponentRepeat.cpp
src/parser/ComponentSequence.cpp
src/parser/Parser.rl
src/parser/buildstate.cpp
src/rose/rose_build_add.cpp
src/rose/rose_build_add_mask.cpp
src/rose/rose_build_anchored.cpp
src/rose/rose_build_bytecode.cpp
src/rose/rose_build_convert.cpp
src/rose/rose_build_dedupe.cpp
src/rose/rose_build_exclusive.cpp
src/rose/rose_build_matchers.cpp
src/rose/rose_build_misc.cpp
src/rose/rose_build_program.cpp
src/rose/rose_build_program.h
src/rose/rose_in_util.cpp
src/smallwrite/smallwrite_build.cpp
src/som/slot_manager.cpp
src/util/clique.cpp
src/util/make_unique.h [deleted file]
tools/hsbench/engine_chimera.cpp
tools/hsbench/engine_hyperscan.cpp
tools/hsbench/engine_pcre.cpp
tools/hsbench/main.cpp
tools/hscheck/main.cpp
tools/hscollider/GraphTruth.cpp
tools/hscollider/GroundTruth.cpp
tools/hscollider/UltimateTruth.cpp
tools/hscollider/main.cpp
unit/internal/multi_bit.cpp
unit/internal/multi_bit_compress.cpp
unit/internal/pack_bits.cpp
unit/internal/repeat.cpp
unit/internal/rose_build_merge.cpp
unit/internal/shufti.cpp
unit/internal/simd_utils.cpp
util/cross_compile.cpp
util/ng_corpus_generator.cpp

index 46536f31221c273785ddc25d9762e6e78a5fe8ab..fbe8fe534387e26d258b6c7728c2c65eab4f95b4 100644 (file)
@@ -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();
index a19f43909a128db5df8cb534d26f87206858d630..af0f35de326506ed66a7cecfa1e5d8f99cf1e0ee 100644 (file)
@@ -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;
 }
index 2f9ba420c0357776b5fb15bb371d0f59cf9ddfc2..c4f5925886972e9a22e5651be7d8a60fbe1af731 100644 (file)
@@ -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
index d797c53b2587f7960aba55ea4b78a79d3a47d3e4..9fb7b26ba723edb2d30db5229913e139522e4102 100644 (file)
@@ -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);
 }
 
index 88ae0f53821aec8baf9af56b7f1d66cc11c89fbc..7cd33ab23ec4bd794464745fa47fd9b22025875b 100644 (file)
@@ -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);
         }
     }
 
index 1b332815290d77d31629a54d92878c95f23e07e5..615224fe06dff2698dd6a2489b85152f17a491f5 100644 (file)
@@ -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,
index 698c07e6f0fa2bd1ff492f358883d26d6838da73..20bc292570c0d880e41555e6cff136625cec6851 100644 (file)
@@ -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);
index 4b3d0c3df8616662970eac5a5f94d3a93723874c..3bf729b34720757c1395b669c4e897f4b38844f7 100644 (file)
@@ -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());
index 2ea7fcb451a1cf84e297bee4209a9da6f236b0e2..b5c3a8ac656b44a3b826d0cbd799f93171383eae 100644 (file)
@@ -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) {
index fea4062c19cfed562fced1c1d2f247a2e0a3a5be..622362bea114445ad95e6798ebb1ddd5684397bd 100644 (file)
@@ -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"
index 07b1c550a17f919c90b2dcf0753355d9f1e7e3f7..8506f90b9a89173a6c88c8ab955de4c83f0c2f1a 100644 (file)
@@ -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");
index f343679b425b6bcf9237d0138a7ab47d07236c39..240d6c08f6fe3717ec67a0768b96e93d43e8293c 100644 (file)
@@ -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) {
index 8dccf9863d47d5c4100dd9cc88007a4bdd76dc17..b2a8752361bc454f3ed2146a642d11a7c4126e84 100644 (file)
@@ -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;
index 60f667f49122365ea8278204cc30ceb2e02a5ab4..72beba3e6f1ef24ddbaecb3b8bfb9ab0d1946cf7 100644 (file)
@@ -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() { }
index 5be1ff0d0f2c0bdf23a7ae3c5c441768ec142ccc..2d26aae6f6056187fc66a064bdd9aca03b971c0b 100644 (file)
@@ -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);
 
index 5af0c012989335d9c0d55d0a326adf44d178f16f..c575ad2f055dabd78a403e3049fdbd62a1b6ecb3 100644 (file)
@@ -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();
     }
 
index 156b8f6b20cfe19ddc755d3fceb7d8e016a6f780..bf951a0b0bf4e0cbe2d603c1d10b1cb244a1afa6 100644 (file)
@@ -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);
 
index 35a09d0ea25f416d29e7cc4da9e1d21ee7403200..ca6e30b3f38a15c4f14b82d8e3f2af68e1142dd8 100644 (file)
@@ -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;
 
index b8367cd65a1e5db97a2491953b90e228f2a13bd5..d3a42b5900f43e5b240d03cde502b434daad16df 100644 (file)
@@ -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>
index c361c3bea32052f3f2f9fd6fd1a21232af68224f..1e4b743f7c63e7cef53fd24d1d97b9192a82eb54 100644 (file)
@@ -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
index fcc61a418f254f8cf63b0492b7357f4f2133a731..10d93fb842288155187173e60388392339e0a9f8 100644 (file)
@@ -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> &regions,
     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;
index 45ad7a3a3602e9961a94c277585a88fd1c621b75..b1d39d2e3a6d5019a7cdba600edb0578fa3ff879 100644 (file)
@@ -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;
 }
index ceceb19c63d937a7c4a851207d9275e042fbb437..4a5b492cc98340294b42a3c34e3edb7cac0d8852 100644 (file)
@@ -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;
 
index a91ae979ff1a5a2a13015a377adfdbc1a86d2285..106c1dab72c3dcf6ac5cb0f1dd9cc6fdc7aaf21c 100644 (file)
@@ -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);
     }
 }
 
index 984026f0579ef4509089a20628d67f09500b4c2f..4bd51e1a7bc59aa5ff995caa74fd5cd20e97da8c 100644 (file)
@@ -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
index 7dbf61e8e62747f3f483d5c435aeb3ff2d76478a..fc82c11f3a3ea679ceb04dcf22b1725ae5ff8fb7 100644 (file)
@@ -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));
 }
index 8643aebfc6ff7b83dd765156ba8c60f5caa23b75..0fa76aca339653fca7adc8208a637fb6bb20c4d7 100644 (file)
@@ -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
index 3a2bb7d99789bc80e368ef9098c13022d8e8ca02..96f91cb6cd5865b4aa561ddf03bd9bb6d2b2192a 100644 (file)
@@ -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
index 357fbb84699c0b4d0478758bc0453236368e8ce0..dc9ee308898290e16ebee88abda0e770cda1a408 100644 (file)
@@ -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();
index a0b7ecd92fcbf43d7abea839e784c806f9d87754..c3736f62f48bd845d5312fe7dee3ef811a08c372 100644 (file)
@@ -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;
index fd0cfcbd571bb4656b97b7229fe1d578eb400dd2..862740e4395829c7c8efd15af641422ea3002dcc 100644 (file)
@@ -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;
index ec9d5d17e277f4d81abbab97f6bb859cff493691..fb2d50a5abfd673ec4d08976e61893e4e6e95dcc 100644 (file)
@@ -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();
index 372345200f1e2529f71203ac7d7bde744bc5a85f..b8d0a09bb3250caf59c80bbc5b00df0aed54c199 100644 (file)
@@ -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) {
index d56a1d4f39e7c5b97bb8c0a4e727f82305d87a27..0a19480a472e4d21c34666118273cf11ae6d6e86 100644 (file)
@@ -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;
index 8a1f3f9435801ad9b690ebb2b7af7b2b9aabe359..bc9b15582ce5865a186e2e72cb5cfbd6b809a3d4 100644 (file)
@@ -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) {
index 819787da1218e0137f0043cbac7c55ee14d3f3df..ba141d35285e2fe82a94f33e51edd47bd04608d8 100644 (file)
@@ -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
index f2f80ec513412ae8480ff810fa7e24025039333f..d3ff236d2932631e66706783928ee5dfa26f180f 100644 (file)
@@ -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) {
index 46a19e71506abc2b82b3905c951851dd80477b27..3ddf2fcdc3a22f9da0b943de7f31f22b0851f58f 100644 (file)
@@ -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));
     }
 }
index 7d781f3191edc83405723d23b900aadd1374f07d..6ad5529c3ba115b600f81e4d7a7ad656f29c9a79 100644 (file)
@@ -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>
index 9fe47c2765f3ca429573a94dcce072a08dfff2fa..c26280821ebdae19ebb4f1d55d56d8b5530ebd5c 100644 (file)
@@ -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;
index 26291f44fae2e1a33150aad4ccaa89a868074ebb..5dad47041dce9df59a41673b85375f39ad0acc79 100644 (file)
@@ -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) {
index c81d055fa3408cfd702fc310cb02058e59007032..9984d8365ca0bb302267ca5592408e2c3a82605d 100644 (file)
@@ -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() { }
index 33a3e119987c7f785304c2195b4496b784ed4909..a8195d0cb56d3d1803718f24660d56b79c7bc161 100644 (file)
@@ -33,7 +33,6 @@
 #include "clique.h"
 #include "container.h"
 #include "graph_range.h"
-#include "make_unique.h"
 
 #include <map>
 #include <set>
diff --git a/src/util/make_unique.h b/src/util/make_unique.h
deleted file mode 100644 (file)
index 651e8c5..0000000
+++ /dev/null
@@ -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
index 24a99d61f507b72e7580b17df649eb3be6532a2d..b310c21460cb6256deee8b4a9c04a489ae7ae965 100644 (file)
@@ -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));
 }
index c94b42af73334b3d2cc48d047fb7adfc35bf9600..4898c0bfc0c8d8b6e067cefed912347a84b616bf 100644 (file)
@@ -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));
 }
index 23ab9d176c033a666a7653d09b4bbf1d9feaa645..f2ad303d5a11929e17213738c4511c378fc2d956 100644 (file)
@@ -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);
 }
index 1c91813b281a3740945bf43c29b71b1d15e3951d..45db8a619e5ddda819cb263d7e07c6c39db42fef 100644 (file)
@@ -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. */
index 197087bba6e4fc0f001e94de0d9f40417d759140..0b44b3a219ff44226bef40662a3d5e165e66c5e2 100644 (file)
@@ -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);
 
index 0b67b11c5fb9b7f874b2cd0178a88dd893c70ee0..6069ff5cb4a90d523ddbb57e51ed7e907b49847a 100644 (file)
@@ -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
index a2673063c153483e5f5562ec74ae3884ecd5a5b3..11ff40e3b8d412af6fd67e594182f99bc5106d8e 100644 (file)
@@ -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;
index 038fbf777d85b5f32ea8fef697dc9a91f1208b59..c448b780cd00f72618cd2001c972d9eb1cb9ce71 100644 (file)
@@ -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
 
index afa6ef5a92b36025a6367d2b0655031a58f80f00..f6ef1d437f61107956f8dd0c1d1aaf420f8aecb5 100644 (file)
@@ -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();
index 2b0c7c7976b8cd32773c0a69c85afabfef8f44eb..c7632d3a0e02964c8af56216d6434820f911faaa 100644 (file)
@@ -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));
index d7396b8113aa9522546a5ada23da2b611b4f1f41..2d59ea146a973318804cdb36f250f743a2d6a70e 100644 (file)
@@ -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);
index aa0a35eb7f4b845c4b08c9ce0390e5de5362d331..453dccfd4b399dfe48999f640079e36622d1136b 100644 (file)
@@ -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);
 
index 546d7d4f882589ff9ea2f5f363797d413ba030aa..5665a0c3ed44e9bf867c11797266efa8895621bd 100644 (file)
@@ -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);
index 5029f0a5391ac656ec595c487265a19fabc8b2a8..73abff4d170fa8e41ed7717e26c56703e8873712 100644 (file)
@@ -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);
index 0c9d26071dfcd046a680105a40e335ff5a70445f..9a4a498354cb8c0b83a9e1cff76bc4793ce28cd6 100644 (file)
@@ -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);
index da9bb62ac6a8547eb142d21aca2db0febc3e31a2..2a9accae3042b62033e645aff5ca7062339c615e 100644 (file)
@@ -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++) {
index 0d13699844134d49fe43a5da6902f0c181ea0675..df2aff5a007c0370c5bfe4b2410a91deb27227fd 100644 (file)
@@ -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);
     }
 }
 
index e5e8e06cd95f822ddf78f2577de212ad1163cc64..145a0ab8ee5c365ad53611fd0740897091a956eb 100644 (file)
@@ -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);
     }
 }