This is an archive of the discontinued LLVM Phabricator instance.

[FileCheck] Share variable instance among uses
ClosedPublic

Authored by thopre on Jul 4 2019, 4:49 PM.

Details

Summary

This patch changes expression support to use one instance of
FileCheckNumericVariable per numeric variable rather than one per
variable and per definition. The current system was only necessary for
the last patch of the numeric expression support patch series in order
to handle a line using a variable defined earlier on the same line from
the input text. However this can be dealt more efficiently.

Event Timeline

thopre created this revision.Jul 4 2019, 4:49 PM
jhenderson accepted this revision.Jul 5 2019, 1:36 AM

Thanks! I think this makes more sense now too. LGTM.

llvm/lib/Support/FileCheck.cpp
260

Nit: is this required here?

This revision is now accepted and ready to land.Jul 5 2019, 1:36 AM
thopre updated this revision to Diff 208149.Jul 5 2019, 4:58 AM
thopre marked an inline comment as done.

Address review comments

jhenderson accepted this revision.Jul 5 2019, 5:38 AM
thopre updated this revision to Diff 208180.Jul 5 2019, 7:32 AM

Also share the @LINE numeric variable class instance

thopre requested review of this revision.Jul 5 2019, 7:33 AM
jhenderson accepted this revision.Jul 5 2019, 7:53 AM

LGTM, with one nit.

llvm/include/llvm/Support/FileCheck.h
301

when pattern are -> when a pattern is | when patterns are

This revision is now accepted and ready to land.Jul 5 2019, 7:53 AM
This revision was automatically updated to reflect the committed changes.