aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-04-07 18:44:36 +0000
committerNikita Popov <nikita.ppv@gmail.com>2019-04-07 18:44:36 +0000
commit4246106abac4b0803d46936b808f2bb0c7c18887 (patch)
tree1c3df4daa6cdbf13765c9bf4c039d28ae575eeb0 /clang/lib/Frontend/CompilerInvocation.cpp
parenta51883cfab4ea36215549a58f29d65b862ef857c (diff)
downloadllvm-4246106abac4b0803d46936b808f2bb0c7c18887.zip
llvm-4246106abac4b0803d46936b808f2bb0c7c18887.tar.gz
llvm-4246106abac4b0803d46936b808f2bb0c7c18887.tar.bz2
[ConstantRange] Add unsigned and signed intersection types
The intersection of two ConstantRanges may consist of two disjoint ranges. As we can only return one range as the result, we need to return one of the two possible ranges that cover both. Currently the result is picked based on set size. However, this is not always optimal: If we're in an unsigned context, we'd prefer to get a large unsigned range over a small signed range -- the latter effectively becomes a full set in the unsigned domain. This revision adds a PreferredRangeType, which can be either Smallest, Unsigned or Signed. Smallest is the current behavior and Unsigned and Signed are new variants that prefer not to wrap the unsigned/signed domain. The new type isn't used anywhere yet (but SCEV will be a good first user, see D60035). I've also added some comments to illustrate the various cases in intersectWith(), which should hopefully make it more obvious what is going on. Differential Revision: https://reviews.llvm.org/D59959 llvm-svn: 357873
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions