summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-07 22:17:20 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-07 22:17:20 +0000
commitda634f1dee69f30e3a2521e22c2031c5e6930807 (patch)
tree91d0df85c8913cd3e7aeacc82b7e199f8392ac73 /clang/lib/AST/DeclBase.cpp
parent1e50b46bf96af955193408ba2dc157d007339eac (diff)
downloadbcm5719-llvm-da634f1dee69f30e3a2521e22c2031c5e6930807.tar.gz
bcm5719-llvm-da634f1dee69f30e3a2521e22c2031c5e6930807.zip
In my tests, I'm finding that declaring iterators in terms of ranges can sometimes have dangerous side-effects where the range temporary is destroyed, taking the underlying iterators out with it.
This changes the iterators so that they are no longer implemented in terms of ranges (so it's a very partial revert of the existing rangification efforts). llvm-svn: 203299
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 711946ea009..5797e554a3c 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -1080,12 +1080,22 @@ DeclContext::decl_range DeclContext::noload_decls() const {
return decl_range(decl_iterator(FirstDecl), decl_iterator());
}
+DeclContext::decl_iterator DeclContext::noload_decls_begin() const {
+ return decl_iterator(FirstDecl);
+}
+
DeclContext::decl_range DeclContext::decls() const {
if (hasExternalLexicalStorage())
LoadLexicalDeclsFromExternalStorage();
return decl_range(decl_iterator(FirstDecl), decl_iterator());
}
+DeclContext::decl_iterator DeclContext::decls_begin() const {
+ if (hasExternalLexicalStorage())
+ LoadLexicalDeclsFromExternalStorage();
+ return decl_iterator(FirstDecl);
+}
+
bool DeclContext::decls_empty() const {
if (hasExternalLexicalStorage())
LoadLexicalDeclsFromExternalStorage();
OpenPOWER on IntegriCloud