Skip to content

Commit 1f650d2

Browse files
committed
[MERGE #5424 @dilijev] regexBytecodeDebug: Fix printing of set negations; don't print sizeof and alignof
Merge pull request #5424 from dilijev:regexBytecodeDebug-printFix Noticed a few bugs while helping @kfukuda2 debug Regex. * -regexDebug: Output of bytecode names for set negations and non-negations were swapped in a few places. * -regexBytecodeDebug: sizeof and alignof were previously useful to see wasted space in bytecode layout, but now that bytecode is packed, they provide no additional information.
2 parents a224c1a + 675ce01 commit 1f650d2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Parser/RegexRuntime.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ namespace UnifiedRegex
384384
size_t size = sizeof(*((T *)that));
385385
byte *endByte = startByte + size;
386386
byte *currentByte = startByte;
387-
w->Print(_u("0x%p[+0x%03x](0x%03x)(size:0x%02x)(align:0x%02x) [%s]:"), startByte, offset, size, sizeof(T), alignof(T), annotation);
387+
w->Print(_u("0x%p[+0x%03x](0x%03x) [%s]:"), startByte, offset, size, annotation);
388388

389389
for (; currentByte < endByte; ++currentByte)
390390
{
@@ -409,7 +409,7 @@ namespace UnifiedRegex
409409
byte *startByte = (byte *)(&(start->tag));
410410
byte *endByte = startByte + size;
411411
byte *currentByte = startByte;
412-
w->Print(_u("0x%p[+0x%03x](0x%03x)(size:0x%02x)(align:0x%02x) [%s]:"), startByte, offsetToData, size, sizeof(Inst), alignof(Inst), annotation);
412+
w->Print(_u("0x%p[+0x%03x](0x%03x) [%s]:"), startByte, offsetToData, size, annotation);
413413
for (; currentByte < endByte; ++currentByte)
414414
{
415415
if ((currentByte - endByte) % 4 == 0)
@@ -1907,12 +1907,12 @@ namespace UnifiedRegex
19071907
{
19081908
if (IsNegation)
19091909
{
1910-
PRINT_RE_BYTECODE_BEGIN("SyncToSetAndContinue");
1910+
PRINT_RE_BYTECODE_BEGIN("SyncToNegatedSetAndContinue");
19111911
PRINT_MIXIN(SetMixin<true>);
19121912
}
19131913
else
19141914
{
1915-
PRINT_RE_BYTECODE_BEGIN("SyncToNegatedSetAndContinue");
1915+
PRINT_RE_BYTECODE_BEGIN("SyncToSetAndContinue");
19161916
PRINT_MIXIN(SetMixin<false>);
19171917
}
19181918

@@ -2120,12 +2120,12 @@ namespace UnifiedRegex
21202120
{
21212121
if (IsNegation)
21222122
{
2123-
PRINT_RE_BYTECODE_BEGIN("SyncToSetAndConsume");
2123+
PRINT_RE_BYTECODE_BEGIN("SyncToNegatedSetAndConsume");
21242124
PRINT_MIXIN(SetMixin<true>);
21252125
}
21262126
else
21272127
{
2128-
PRINT_RE_BYTECODE_BEGIN("SyncToNegatedSetAndConsume");
2128+
PRINT_RE_BYTECODE_BEGIN("SyncToSetAndConsume");
21292129
PRINT_MIXIN(SetMixin<false>);
21302130
}
21312131

@@ -2352,12 +2352,12 @@ namespace UnifiedRegex
23522352
{
23532353
if (IsNegation)
23542354
{
2355-
PRINT_RE_BYTECODE_BEGIN("SyncToSetAndBackup");
2355+
PRINT_RE_BYTECODE_BEGIN("SyncToNegatedSetAndBackup");
23562356
PRINT_MIXIN_COMMA(SetMixin<true>);
23572357
}
23582358
else
23592359
{
2360-
PRINT_RE_BYTECODE_BEGIN("SyncToNegatedSetAndBackup");
2360+
PRINT_RE_BYTECODE_BEGIN("SyncToSetAndBackup");
23612361
PRINT_MIXIN_COMMA(SetMixin<false>);
23622362
}
23632363

0 commit comments

Comments
 (0)