summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@anl.gov>2019-08-12 22:07:34 +0000
committerJohannes Doerfert <jdoerfert@anl.gov>2019-08-12 22:07:34 +0000
commitacc8079f8e6ff19fca4db46706d4b334a9094eba (patch)
tree8383c2892c2745bf68292baf12a872602b349a4d
parentece81904977259da86b7a52f2c2081bacbbd61a2 (diff)
downloadbcm5719-llvm-acc8079f8e6ff19fca4db46706d4b334a9094eba.tar.gz
bcm5719-llvm-acc8079f8e6ff19fca4db46706d4b334a9094eba.zip
[Attributor][NFC] Add IntegerState raw_ostream << operator
llvm-svn: 368622
-rw-r--r--llvm/include/llvm/Transforms/IPO/Attributor.h1
-rw-r--r--llvm/lib/Transforms/IPO/Attributor.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index c17ff5d2f2a..402f6a6263e 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -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> {
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index ad27b81945a..40a0c2657a7 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -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" : ""));
}
OpenPOWER on IntegriCloud