ruiu accepted this revision. ruiu added a comment. This revision is now accepted and ready to land. Ah, ok, it's new code. Uses of 0 and -1 are a bit too mysterious. Please define constants for them. With that, LGTM. http://reviews.llvm.org/D19953