]> granicus.if.org Git - clang/commitdiff
Add a little helper method which will be useful soon.
authorJohn McCall <rjmccall@apple.com>
Wed, 21 Jul 2010 00:40:03 +0000 (00:40 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 21 Jul 2010 00:40:03 +0000 (00:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108972 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.h

index f236eb42538f10a81973f575c3038ef55a160f7e..d335e2b4f827c5aaf3ea8066f95ec03fc7db4472 100644 (file)
@@ -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;
     }