#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"
// 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();
#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"
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;
}
#include "hs_compile.h"
#include "util/target_info.h"
#include "util/compare.h" // for ourisalpha()
-#include "util/make_unique.h"
#include <cassert>
#include <cstdlib>
}
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,
return nullptr;
}
- return ue2::make_unique<FDREngineDescription>(allDescs[engineID]);
+ return std::make_unique<FDREngineDescription>(allDescs[engineID]);
}
} // namespace ue2
#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"
return nullptr;
}
- return ue2::make_unique<HWLMProto>(engType, move(des), lits,
+ return std::make_unique<HWLMProto>(engType, move(des), lits,
bucketToLits, make_small);
}
#include "fdr_engine_description.h"
#include "teddy_internal.h"
#include "teddy_engine_description.h"
-#include "util/make_unique.h"
#include <cmath>
}
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) {
for (const auto &desc : descs) {
if (desc.getID() == engineID) {
- return ue2::make_unique<TeddyEngineDescription>(desc);
+ return std::make_unique<TeddyEngineDescription>(desc);
}
}
#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>
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,
#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"
}
}
- 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);
#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"
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) {
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());
#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"
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) {
#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"
#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"
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)) {
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");
#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"
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) {
#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;
#include "ue2common.h"
#include "compiler/compiler.h" // for ParsedExpression
#include "util/compile_error.h"
-#include "util/make_unique.h"
#include <cassert>
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
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() { }
#include "ue2common.h"
#include "util/graph_range.h"
#include "util/graph_undirected.h"
-#include "util/make_unique.h"
#include <map>
#include <vector>
* 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);
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);
#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>
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();
}
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();
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();
}
#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>
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);
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);
#include "util/container.h"
#include "util/flat_containers.h"
#include "util/graph_range.h"
-#include "util/make_unique.h"
using namespace std;
#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>
#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>
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
#include "util/container.h"
#include "util/dump_charclass.h"
#include "util/graph_range.h"
-#include "util/make_unique.h"
#include <algorithm>
#include <map>
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;
#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"
}
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;
}
#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"
#include <set>
#include <utility>
#include <vector>
+#include <memory>
#include <boost/dynamic_bitset.hpp>
#include <boost/range/adaptor/map.hpp>
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
}
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));
}
}
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
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;
#include "ucp_table.h"
#include "Utf8ComponentClass.h"
#include "util/charreach.h"
-#include "util/make_unique.h"
#include <boost/icl/interval_set.hpp>
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);
}
}
#include "position_dump.h"
#include "position_info.h"
#include "ue2common.h"
-#include "util/make_unique.h"
#include <algorithm>
#include <cassert>
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
#include "position_info.h"
#include "nfagraph/ng_builder.h"
#include "util/container.h"
-#include "util/make_unique.h"
#include <algorithm>
#include <cassert>
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));
}
#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"
# 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));
}
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));
PUSH_SEQUENCE;
mode = newMode;
currentSeq =
- enterSequence(currentSeq, ue2::make_unique<ComponentSequence>());
+ enterSequence(currentSeq, std::make_unique<ComponentSequence>());
}
action exitGroup {
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 {
}
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);
}
action applyModifiers {
mode = newMode;
- currentSeq->addComponent(ue2::make_unique<ComponentEmpty>());
+ currentSeq->addComponent(std::make_unique<ComponentEmpty>());
}
action modifyMatchPositive {
switch (fc) {
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 {
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;
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)
'\*' => {
'\^' => {
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));
};
#############################################################
// 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);
}
'\\' 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
};
'\\X' => {
- currentSeq->addComponent(ue2::make_unique<ComponentEUS>(ts - ptr, mode));
+ currentSeq->addComponent(std::make_unique<ComponentEUS>(ts - ptr, mode));
};
# Fall through general escaped character
# 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;
};
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
#include "util/container.h"
#include "util/flat_containers.h"
#include "util/hash.h"
-#include "util/make_unique.h"
#include "util/unordered.h"
#include <algorithm>
// 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
#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"
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 */
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();
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();
#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"
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);
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;
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;
#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"
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);
}
}
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;
#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"
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();
#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"
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) {
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) {
#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;
};
unique_ptr<RoseDedupeAux> RoseBuildImpl::generateDedupeAux() const {
- return ue2::make_unique<RoseDedupeAuxImpl>(*this);
+ return std::make_unique<RoseDedupeAuxImpl>(*this);
}
RoseDedupeAux::~RoseDedupeAux() = default;
#include "util/container.h"
#include "util/flat_containers.h"
#include "util/graph.h"
-#include "util/make_unique.h"
using namespace std;
}
// 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) {
#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"
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>
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>
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>
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
#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"
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) {
}
RoseProgram::RoseProgram() {
- prog.emplace_back(make_unique<RoseInstrEnd>());
+ prog.emplace_back(std::make_unique<RoseInstrEnd>());
}
RoseProgram::~RoseProgram() = default;
}
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
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);
}
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));
}
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));
}
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));
return;
}
- program.add_before_end(make_unique<RoseInstrCatchUp>());
+ program.add_before_end(std::make_unique<RoseInstrCatchUp>());
}
static
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));
}
}
// 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));
}
// 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));
}
// 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));
}
// 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) {
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 {
} else {
if (!report.quiet) {
report_block.add_before_end(
- make_unique<RoseInstrReport>(
+ std::make_unique<RoseInstrReport>(
report.onmatch, report.offsetAdjust));
}
}
}
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));
}
}
}
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;
}
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);
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);
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;
}
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
});
for (const auto &ri : delay_instructions) {
- program.add_before_end(make_unique<RoseInstrPushDelayed>(ri));
+ program.add_before_end(std::make_unique<RoseInstrPushDelayed>(ri));
}
}
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));
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));
}
}
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));
}
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
return;
}
- program.add_before_end(make_unique<RoseInstrSetGroups>(groups));
+ program.add_before_end(std::make_unique<RoseInstrSetGroups>(groups));
}
static
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;
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;
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;
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;
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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;
return;
}
- auto ri = make_unique<RoseInstrCheckLookaround>(look,
+ auto ri = std::make_unique<RoseInstrCheckLookaround>(look,
program.end_instruction());
program.add_before_end(move(ri));
}
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
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
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));
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);
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));
event = MQE_TOP;
}
- prog.add_before_end(make_unique<RoseInstrTriggerSuffix>(queue, event));
+ prog.add_before_end(std::make_unique<RoseInstrTriggerSuffix>(queue, event));
}
static
});
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));
}
}
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
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 {
* 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));
}
return;
}
- program.add_before_end(make_unique<RoseInstrCatchUpMpv>());
+ program.add_before_end(std::make_unique<RoseInstrCatchUpMpv>());
}
RoseProgram makeReportProgram(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));
}
// 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));
}
}
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;
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;
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));
}
}
#include "rose_program.h"
#include "util/bytecode_ptr.h"
#include "util/hash.h"
-#include "util/make_unique.h"
#include <unordered_map>
#include <vector>
#include "nfagraph/ng_width.h"
#include "util/container.h"
#include "util/graph_range.h"
-#include "util/make_unique.h"
#include <vector>
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;
#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"
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) {
#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"
}
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() { }
#include "clique.h"
#include "container.h"
#include "graph_range.h"
-#include "make_unique.h"
#include <map>
#include <set>
+++ /dev/null
-/*
- * 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
#include "chimera/ch_database.h"
-#include "util/make_unique.h"
-
using namespace std;
EngineCHContext::EngineCHContext(const ch_database_t *db) {
}
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,
cs.compileSecs = compileSecs;
cs.peakMemorySize = peakMemorySize;
- return ue2::make_unique<EngineChimera>(db, move(cs));
+ return std::make_unique<EngineChimera>(db, move(cs));
}
#include "hs_internal.h"
#include "hs_runtime.h"
#include "util/database_util.h"
-#include "util/make_unique.h"
#include <cassert>
#include <cstring>
}
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,
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);
cs.compileSecs = compileSecs;
cs.peakMemorySize = peakMemorySize;
- return ue2::make_unique<EngineHyperscan>(db, std::move(cs));
+ return std::make_unique<EngineHyperscan>(db, std::move(cs));
}
#include "sqldb.h"
#include "timer.h"
-#include "util/make_unique.h"
#include "util/unicode_def.h"
#include <algorithm>
}
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,
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);
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);
}
#include "grey.h"
#include "hs.h"
#include "ue2common.h"
-#include "util/make_unique.h"
#include <algorithm>
#include <clocale>
}
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. */
#include "expressions.h"
#include "string_util.h"
#include "util/expression_path.h"
-#include "util/make_unique.h"
#include "grey.h"
#include "hs_compile.h"
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);
#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>
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));
// 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
#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"
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;
#include "crc32.h"
#include "hs.h"
#include "hs_internal.h"
-#include "util/make_unique.h"
#include "scratch.h"
#include "nfa/nfa_api_queue.h"
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
return nullptr;
}
- return ue2::make_unique<HybridDB>(db, idsvec.begin(), idsvec.end());
+ return std::make_unique<HybridDB>(db, idsvec.begin(), idsvec.end());
}
#endif
#include "parser/utf8_validate.h"
#include "ue2common.h"
#include "util/container.h"
-#include "util/make_unique.h"
#include <algorithm>
#include <cassert>
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++;
// 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);
}
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;
}
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);
}
// 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));
}
// 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();
#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"
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);
}
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));
}
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));
#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"
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);
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);
#include "gtest/gtest.h"
#include "util/pack_bits.h"
-#include "util/make_unique.h"
#include "ue2common.h"
#include <algorithm>
// 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);
#include "nfa/repeat.h"
#include "nfa/repeatcompile.h"
#include "util/depth.h"
-#include "util/make_unique.h"
#include <algorithm>
#include <memory>
// 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);
#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"
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);
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);
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);
#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;
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++) {
#include "cross_compile.h"
#include "src/ue2common.h"
#include "src/hs_compile.h"
-#include "src/util/make_unique.h"
#include <sstream>
#include <string>
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);
}
}
#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"
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)) {
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);
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);
}
}