aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Scope.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/Scope.cpp')
-rw-r--r--lib/Sema/Scope.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/Scope.cpp b/lib/Sema/Scope.cpp
index c76f61af6c..10f12ce844 100644
--- a/lib/Sema/Scope.cpp
+++ b/lib/Sema/Scope.cpp
@@ -59,3 +59,13 @@ void Scope::Init(Scope *parent, unsigned flags) {
Entity = 0;
ErrorTrap.reset();
}
+
+bool Scope::containedInPrototypeScope() const {
+ const Scope *S = this;
+ while (S) {
+ if (S->isFunctionPrototypeScope())
+ return true;
+ S = S->getParent();
+ }
+ return false;
+}