[Attributor][NFC] Add IntegerState raw_ostream << operator
authorJohannes Doerfert <jdoerfert@anl.gov>
Mon, 12 Aug 2019 22:07:34 +0000 (22:07 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Mon, 12 Aug 2019 22:07:34 +0000 (22:07 +0000)
llvm-svn: 368622

llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp

index c17ff5d2f2a7e1dec24ea57538c1941ee4640300..402f6a6263e0f573c0f96dc58b46faf39582174f 100644 (file)
@@ -871,6 +871,7 @@ raw_ostream &operator<<(raw_ostream &OS, ChangeStatus S);
 raw_ostream &operator<<(raw_ostream &OS, IRPosition::Kind);
 raw_ostream &operator<<(raw_ostream &OS, const IRPosition &);
 raw_ostream &operator<<(raw_ostream &OS, const AbstractState &State);
+raw_ostream &operator<<(raw_ostream &OS, const IntegerState &S);
 ///}
 
 struct AttributorPass : public PassInfoMixin<AttributorPass> {
index ad27b81945a748b573ad1a3d4cae8a639b7709f6..40a0c2657a733604c34c4c76758a20990cbd1473 100644 (file)
@@ -2498,6 +2498,11 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const IRPosition &Pos) {
             << Pos.getAnchorValue().getName() << "@" << Pos.getArgNo() << "]}";
 }
 
+raw_ostream &llvm::operator<<(raw_ostream &OS, const IntegerState &S) {
+  return OS << "(" << S.getKnown() << "-" << S.getAssumed() << ")"
+            << static_cast<const AbstractState &>(S);
+}
+
 raw_ostream &llvm::operator<<(raw_ostream &OS, const AbstractState &S) {
   return OS << (!S.isValidState() ? "top" : (S.isAtFixpoint() ? "fix" : ""));
 }