Skip to content

Commit 9dbcca8

Browse files
Revert change to PrevEnd computation in DeclRewriter::rewriteMultiDecl.
It seems to no longer be needed now that the Rewriter::ReplaceText bug is worked around.
1 parent 739bebc commit 9dbcca8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

clang/lib/3C/DeclRewriter.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,9 @@ void DeclRewriter::rewriteMultiDecl(MultiDeclInfo &MDI, RSet &ToRewrite) {
511511
getDeclSourceRangeWithAnnotations(DL, /*IncludeInitializer=*/true);
512512
SourceRange Comma = getNextComma(SkipSR.getEnd());
513513
rewriteSourceRange(R, Comma, ";\n");
514-
// Offset to skip past what we've just added so it isn't overwritten.
515-
// If a duplicate declaration was emitted for as part of rewriting a
516-
// declaration, then the offset must be 2 to skip past that as well.
517-
unsigned int Offset = 1;
518-
if (Replacement && !Replacement->getSupplementaryDecls().empty())
519-
Offset = 2;
520-
PrevEnd = Comma.getEnd().getLocWithOffset(Offset);
514+
// Offset by one to skip past what we've just added so it isn't
515+
// overwritten.
516+
PrevEnd = Comma.getEnd().getLocWithOffset(1);
521517
}
522518
}
523519

0 commit comments

Comments
 (0)