16#ifndef LLVM_SUPPORT_INTEGER_INCLUSIVE_INTERVAL_H
17#define LLVM_SUPPORT_INTEGER_INCLUSIVE_INTERVAL_H
40 : Begin(Begin), End(End) {
41 assert(Begin <= End &&
"Interval Begin must be <= End");
47 int64_t
getEnd()
const {
return End; }
50 assert(NewBegin <= End &&
"Interval Begin must be <= End");
54 assert(Begin <= NewEnd &&
"Interval Begin must be <= End");
63 return Begin <=
Other.End && End >=
Other.Begin;
71 OS << Begin <<
"-" << End;
75 return Begin ==
Other.Begin && End ==
Other.End;
91 char Separator =
',');
104 char Separator =
',');
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Tagged union holding either a T or a Error.
void print(raw_ostream &OS) const
Print the interval to the output stream.
bool overlaps(const IntegerInclusiveInterval &Other) const
Check if this interval overlaps with another interval.
void setBegin(int64_t NewBegin)
bool operator==(const IntegerInclusiveInterval &Other) const
void setEnd(int64_t NewEnd)
bool contains(int64_t Value) const
Check if the given value is within this interval (inclusive).
IntegerInclusiveInterval(int64_t Single)
Create a singleton interval [Single, Single].
IntegerInclusiveInterval(int64_t Begin, int64_t End)
Create an interval [Begin, End].
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
void printIntervals(raw_ostream &OS, ArrayRef< IntegerInclusiveInterval > Intervals, char Separator=',')
Print intervals to output stream.
IntervalList mergeAdjacentIntervals(ArrayRef< IntegerInclusiveInterval > Intervals)
Merge adjacent/consecutive intervals into single intervals.
bool contains(ArrayRef< IntegerInclusiveInterval > Intervals, int64_t Value)
Check if a value is contained in any of the intervals.
SmallVector< IntegerInclusiveInterval, 8 > IntervalList
A list of integer intervals.
Expected< IntervalList > parseIntervals(StringRef IntervalStr, char Separator=',')
Parse a interval specification string like "1-10,20-30,45" or "1-10:20-30:45".
This is an optimization pass for GlobalISel generic memory operations.