mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
mergeCastle: merge common repeats from the castles
This commit is contained in:
parent
f8544505ce
commit
1f3cfdccef
@ -772,7 +772,7 @@ bool mergeCastle(CastleProto &c1, const CastleProto &c2,
|
|||||||
const u32 top = m.first;
|
const u32 top = m.first;
|
||||||
const PureRepeat &pr = m.second;
|
const PureRepeat &pr = m.second;
|
||||||
DEBUG_PRINTF("top %u\n", top);
|
DEBUG_PRINTF("top %u\n", top);
|
||||||
u32 new_top = c1.add(pr);
|
u32 new_top = c1.merge(pr);
|
||||||
top_map[top] = new_top;
|
top_map[top] = new_top;
|
||||||
DEBUG_PRINTF("adding repeat: map %u->%u\n", top, new_top);
|
DEBUG_PRINTF("adding repeat: map %u->%u\n", top, new_top);
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,9 @@ buildCastle(const CastleProto &proto,
|
|||||||
const CompileContext &cc, const ReportManager &rm);
|
const CompileContext &cc, const ReportManager &rm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Merge two CastleProto prototypes together, if possible.
|
* \brief Merge two CastleProto prototypes together, if possible. If a
|
||||||
|
* particular repeat from c2 is already in c1, then it will be reused rather
|
||||||
|
* than adding a duplicate repeat.
|
||||||
*
|
*
|
||||||
* Returns true if merge of all repeats in c2 into c1 succeeds, and fills
|
* Returns true if merge of all repeats in c2 into c1 succeeds, and fills
|
||||||
* mapping with the repeat indices.
|
* mapping with the repeat indices.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user