LLVM  10.0.0svn
ValueLattice.cpp
Go to the documentation of this file.
1 //===- ValueLattice.cpp - Value constraint analysis -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 namespace llvm {
13  if (Val.isUndefined())
14  return OS << "undefined";
15  if (Val.isOverdefined())
16  return OS << "overdefined";
17 
18  if (Val.isNotConstant())
19  return OS << "notconstant<" << *Val.getNotConstant() << ">";
20  if (Val.isConstantRange())
21  return OS << "constantrange<" << Val.getConstantRange().getLower() << ", "
22  << Val.getConstantRange().getUpper() << ">";
23  return OS << "constant<" << *Val.getConstant() << ">";
24 }
25 } // end namespace llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
const APInt & getUpper() const
Return the upper value for this range.
const ConstantRange & getConstantRange() const
Definition: ValueLattice.h:158
bool isConstantRange() const
Definition: ValueLattice.h:145
Constant * getConstant() const
Definition: ValueLattice.h:148
Constant * getNotConstant() const
Definition: ValueLattice.h:153
const APInt & getLower() const
Return the lower value for this range.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Definition: APInt.h:2047
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45