diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index ca2558628eb..82cf91c2572 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -42,13 +42,15 @@ namespace llvm { Interval(unsigned r); + bool empty() const { return ranges.empty(); } + unsigned start() const { - assert(!ranges.empty() && "empty interval for register"); + assert(!empty() && "empty interval for register"); return ranges.front().first; } unsigned end() const { - assert(!ranges.empty() && "empty interval for register"); + assert(!empty() && "empty interval for register"); return ranges.back().second; } diff --git a/include/llvm/CodeGen/LiveIntervals.h b/include/llvm/CodeGen/LiveIntervals.h index ca2558628eb..82cf91c2572 100644 --- a/include/llvm/CodeGen/LiveIntervals.h +++ b/include/llvm/CodeGen/LiveIntervals.h @@ -42,13 +42,15 @@ namespace llvm { Interval(unsigned r); + bool empty() const { return ranges.empty(); } + unsigned start() const { - assert(!ranges.empty() && "empty interval for register"); + assert(!empty() && "empty interval for register"); return ranges.front().first; } unsigned end() const { - assert(!ranges.empty() && "empty interval for register"); + assert(!empty() && "empty interval for register"); return ranges.back().second; } diff --git a/lib/CodeGen/LiveIntervalAnalysis.h b/lib/CodeGen/LiveIntervalAnalysis.h index ca2558628eb..82cf91c2572 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.h +++ b/lib/CodeGen/LiveIntervalAnalysis.h @@ -42,13 +42,15 @@ namespace llvm { Interval(unsigned r); + bool empty() const { return ranges.empty(); } + unsigned start() const { - assert(!ranges.empty() && "empty interval for register"); + assert(!empty() && "empty interval for register"); return ranges.front().first; } unsigned end() const { - assert(!ranges.empty() && "empty interval for register"); + assert(!empty() && "empty interval for register"); return ranges.back().second; }