This is an archive of the discontinued LLVM Phabricator instance.

[SyntaxTree] Remove dead code on dump functions
AbandonedPublic

Authored by eduucaldas on Aug 5 2020, 7:02 AM.

Details

Reviewers
gribozavr2
Summary
  • Node::dumpTokens was never used.
  • ::dumpTokens(llvm::raw_ostream, ArrayRef<syntax::Token>, const SourceManager &SM) was used twice, once by Node::dumpTokens. Additionally it always received as parameter a syntax::Token * pointing to one token only, instead of an ArrayRef

I removed the first and inlined a simplified version of the second in its only caller.

Diff Detail

Event Timeline

eduucaldas created this revision.Aug 5 2020, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2020, 7:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
eduucaldas requested review of this revision.Aug 5 2020, 7:02 AM
eduucaldas edited the summary of this revision. (Show Details)Aug 5 2020, 7:05 AM
eduucaldas added a reviewer: gribozavr2.

Node::dumpTokens was never used.

I think it is because it was meant to be a debugger-only helper. I think we should keep it. However, simplifying static void dumpTokens to only take one token instead of ArrayRef makes sense!

eduucaldas abandoned this revision.Aug 26 2020, 10:11 PM