Florian Hahn | 5133f6f | 2017-09-28 11:09:22 +0000 | [diff] [blame] | 1 | //===- ValueLattice.cpp - Value constraint analysis -------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "llvm/Analysis/ValueLattice.h" |
| 11 | |
| 12 | namespace llvm { |
| 13 | raw_ostream &operator<<(raw_ostream &OS, const ValueLatticeElement &Val) { |
| 14 | if (Val.isUndefined()) |
| 15 | return OS << "undefined"; |
| 16 | if (Val.isOverdefined()) |
| 17 | return OS << "overdefined"; |
| 18 | |
| 19 | if (Val.isNotConstant()) |
| 20 | return OS << "notconstant<" << *Val.getNotConstant() << ">"; |
| 21 | if (Val.isConstantRange()) |
| 22 | return OS << "constantrange<" << Val.getConstantRange().getLower() << ", " |
| 23 | << Val.getConstantRange().getUpper() << ">"; |
| 24 | return OS << "constant<" << *Val.getConstant() << ">"; |
| 25 | } |
| 26 | } // end namespace llvm |