Page MenuHomePhabricator

FileCheck [10/12]: Add support for signed numeric values
Needs ReviewPublic

Authored by thopre on Apr 7 2019, 4:23 PM.

Details

Summary

This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support signed numeric
values, thus allowing negative numeric values.

As such, the patch adds a new class to represent a signed or unsigned
value and add the logic for type promotion and type conversion in
numeric expression mixing signed and unsigned values. It also adds
the %d format specifier to represent signed value.

Finally, it also adds underflow and overflow detection when performing a
binary operation.

Copyright:

  • Linaro (changes up to diff 183612 of revision D55940)
  • GraphCore (changes in later versions of revision D55940 and in new revision created off D55940)

Event Timeline

thopre created this revision.Apr 7 2019, 4:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2019, 4:23 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
thopre updated this revision to Diff 194319.Apr 9 2019, 7:19 AM

Use camel casing for new functions

thopre updated this revision to Diff 194485.Apr 10 2019, 4:45 AM

Make numeric value constructor explicit

tra removed a subscriber: tra.Apr 11 2019, 1:16 PM
thopre updated this revision to Diff 197122.Apr 29 2019, 8:37 AM

Rebase on latest changes

thopre updated this revision to Diff 198035.May 3 2019, 9:26 AM

Rebase on latest changes

thopre updated this revision to Diff 198102.May 3 2019, 3:04 PM

Rebase on latest unittest changes

thopre updated this revision to Diff 198446.May 7 2019, 5:34 AM

Rebase on top of latest changes

thopre updated this revision to Diff 198551.May 7 2019, 3:30 PM

Rebase on top of latest changes

thopre updated this revision to Diff 198648.May 8 2019, 6:53 AM

Rebase on top of latest changes

thopre updated this revision to Diff 198953.May 9 2019, 4:53 PM

Rebase on top of latest changes

thopre updated this revision to Diff 199141.May 11 2019, 7:15 AM

Rebase on top of latest changes

thopre updated this revision to Diff 199239.May 13 2019, 3:58 AM

Rebase on top of latest changes

thopre updated this revision to Diff 199399.May 14 2019, 4:03 AM

Rebase on top of latest changes

rnk removed a reviewer: rnk.May 14 2019, 11:28 AM
rnk removed a subscriber: rnk.
thopre updated this revision to Diff 200476.May 21 2019, 5:56 AM

rebase on top of latest changes

thopre updated this revision to Diff 200553.May 21 2019, 11:15 AM

rebase on top of latest changes

thopre updated this revision to Diff 201985.May 29 2019, 10:53 AM

Rebase on top of latest changes in patch series

thopre updated this revision to Diff 203212.Jun 5 2019, 11:21 AM

Rebase on top of latest changes in the series

thopre updated this revision to Diff 205631.Jun 19 2019, 10:16 AM

Rebase on top of latest changes in the patch series

thopre updated this revision to Diff 205683.Jun 19 2019, 3:15 PM
  • Fix a case of numeric expression -> expression
  • Fix code style
thopre updated this revision to Diff 205765.Jun 20 2019, 2:45 AM

Rebase on latest changes in patch series

arichardson added inline comments.Fri, Jul 26, 2:59 AM
llvm/lib/Support/FileCheck.cpp
131

llvm/include/llvm/Support/CheckedArithmetic.h contains llvm::checkedAdd, llvm::checkedSub, llvm::checkedAddUnsigned and llvm::checkedSubUnsigned, which should make this code much simpler.