[llvm] r173831 - Added some periods to some comments and added an overload for operator<< for type Sequence so I can print out Sequences in debug statements.
Michael Gottesman
mgottesman at apple.com
Tue Jan 29 13:07:51 PST 2013
Author: mgottesman
Date: Tue Jan 29 15:07:51 2013
New Revision: 173831
URL: http://llvm.org/viewvc/llvm-project?rev=173831&view=rev
Log:
Added some periods to some comments and added an overload for operator<< for type Sequence so I can print out Sequences in debug statements.
Modified:
llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
Modified: llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp?rev=173831&r1=173830&r2=173831&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp (original)
+++ llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp Tue Jan 29 15:07:51 2013
@@ -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) {
More information about the llvm-commits
mailing list