[llvm] r368622 - [Attributor][NFC] Add IntegerState raw_ostream << operator

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 15:07:35 PDT 2019


Author: jdoerfert
Date: Mon Aug 12 15:07:34 2019
New Revision: 368622

URL: http://llvm.org/viewvc/llvm-project?rev=368622&view=rev
Log:
[Attributor][NFC] Add IntegerState raw_ostream << operator

Modified:
    llvm/trunk/include/llvm/Transforms/IPO/Attributor.h
    llvm/trunk/lib/Transforms/IPO/Attributor.cpp

Modified: llvm/trunk/include/llvm/Transforms/IPO/Attributor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/Attributor.h?rev=368622&r1=368621&r2=368622&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/Attributor.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/Attributor.h Mon Aug 12 15:07:34 2019
@@ -871,6 +871,7 @@ raw_ostream &operator<<(raw_ostream &OS,
 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> {

Modified: llvm/trunk/lib/Transforms/IPO/Attributor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Attributor.cpp?rev=368622&r1=368621&r2=368622&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Attributor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Attributor.cpp Mon Aug 12 15:07:34 2019
@@ -2498,6 +2498,11 @@ raw_ostream &llvm::operator<<(raw_ostrea
             << 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" : ""));
 }




More information about the llvm-commits mailing list