From: John McCall Date: Wed, 21 Jul 2010 00:40:03 +0000 (+0000) Subject: Add a little helper method which will be useful soon. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bda662cb37d9fe24be4b3cf8ea0f4e550e1f889;p=clang Add a little helper method which will be useful soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108972 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index f236eb4253..d335e2b4f8 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -117,6 +117,10 @@ public: bool isValid() const { return Size >= 0; } + /// \return true if this scope is (non-strictly) nested within the + /// given scope, assuming they're both valid + bool isWithin(stable_iterator I) const { return Size <= I.Size; } + friend bool operator==(stable_iterator A, stable_iterator B) { return A.Size == B.Size; }