[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / lib / Analysis / ValueLattice.cpp
blob627166e2409d3d2d924d60c44111a288dadd3775
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 //===----------------------------------------------------------------------===//
9 #include "llvm/Analysis/ValueLattice.h"
11 namespace llvm {
12 raw_ostream &operator<<(raw_ostream &OS, const ValueLatticeElement &Val) {
13 if (Val.isUnknown())
14 return OS << "unknown";
15 if (Val.isUndef())
16 return OS << "undef";
17 if (Val.isOverdefined())
18 return OS << "overdefined";
20 if (Val.isNotConstant())
21 return OS << "notconstant<" << *Val.getNotConstant() << ">";
23 if (Val.isConstantRangeIncludingUndef())
24 return OS << "constantrange incl. undef <"
25 << Val.getConstantRange(true).getLower() << ", "
26 << Val.getConstantRange(true).getUpper() << ">";
28 if (Val.isConstantRange())
29 return OS << "constantrange<" << Val.getConstantRange().getLower() << ", "
30 << Val.getConstantRange().getUpper() << ">";
31 return OS << "constant<" << *Val.getConstant() << ">";
33 } // end namespace llvm