aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/ObjCARC
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-01-29 21:07:51 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-01-29 21:07:51 +0000
commita519c97b4278970b7104005205c6f42910cb9acb (patch)
tree1633ef9feff46dfdbfdc9231bbadefaf6b647a2f /lib/Transforms/ObjCARC
parent82b83011a1e330e41147dbad97e44939840ba755 (diff)
downloadexternal_llvm-a519c97b4278970b7104005205c6f42910cb9acb.zip
external_llvm-a519c97b4278970b7104005205c6f42910cb9acb.tar.gz
external_llvm-a519c97b4278970b7104005205c6f42910cb9acb.tar.bz2
Added some periods to some comments and added an overload for operator<< for type Sequence so I can print out Sequences in debug statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/ObjCARC')
-rw-r--r--lib/Transforms/ObjCARC/ObjCARCOpts.cpp34
1 files changed, 28 insertions, 6 deletions
diff --git a/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
index 727b4f7..068da13 100644
--- a/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
+++ b/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
@@ -312,13 +312,35 @@ namespace {
/// objc_retain and objc_release are actually needed.
enum Sequence {
S_None,
- S_Retain, ///< objc_retain(x)
- S_CanRelease, ///< foo(x) -- x could possibly see a ref count decrement
- S_Use, ///< any use of x
- S_Stop, ///< like S_Release, but code motion is stopped
- S_Release, ///< objc_release(x)
- S_MovableRelease ///< objc_release(x), !clang.imprecise_release
+ S_Retain, ///< objc_retain(x).
+ S_CanRelease, ///< foo(x) -- x could possibly see a ref count decrement.
+ S_Use, ///< any use of x.
+ S_Release, ///< objc_release(x).
+ S_MovableRelease, ///< objc_release(x), !clang.imprecise_release.
+ S_Stop ///< like S_Release, but code motion is stopped.
};
+
+ raw_ostream &operator<<(raw_ostream &OS, const Sequence S)
+ LLVM_ATTRIBUTE_UNUSED;
+ raw_ostream &operator<<(raw_ostream &OS, const Sequence S) {
+ switch (S) {
+ case S_None:
+ return OS << "S_None";
+ case S_Retain:
+ return OS << "S_Retain";
+ case S_CanRelease:
+ return OS << "S_CanRelease";
+ case S_Use:
+ return OS << "S_Use";
+ case S_Release:
+ return OS << "S_Release";
+ case S_MovableRelease:
+ return OS << "S_MovableRelease";
+ case S_Stop:
+ return OS << "S_Stop";
+ }
+ llvm_unreachable("Unknown sequence type.");
+ }
}
static Sequence MergeSeqs(Sequence A, Sequence B, bool TopDown) {