From: Johannes Doerfert Date: Mon, 12 Aug 2019 22:07:34 +0000 (+0000) Subject: [Attributor][NFC] Add IntegerState raw_ostream << operator X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34aa0a38a60f1304d9790512fd42acc8ec6d052e;p=llvm [Attributor][NFC] Add IntegerState raw_ostream << operator git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368622 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Transforms/IPO/Attributor.h b/include/llvm/Transforms/IPO/Attributor.h index c17ff5d2f2a..402f6a6263e 100644 --- a/include/llvm/Transforms/IPO/Attributor.h +++ b/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 { diff --git a/lib/Transforms/IPO/Attributor.cpp b/lib/Transforms/IPO/Attributor.cpp index ad27b81945a..40a0c2657a7 100644 --- a/lib/Transforms/IPO/Attributor.cpp +++ b/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(S); +} + raw_ostream &llvm::operator<<(raw_ostream &OS, const AbstractState &S) { return OS << (!S.isValidState() ? "top" : (S.isAtFixpoint() ? "fix" : "")); }