summaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclObjC.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-13 01:09:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-13 01:09:41 +0000
commita5f4441de7890953460d95f4e88b9fa432b48dc2 (patch)
treeaafaf87f8cfcbeea81609da726361d694cc04a7f /include/clang/AST/DeclObjC.h
parentcd707abbc758149d9f7d37bd0b25298455c678b2 (diff)
downloadclang-a5f4441de7890953460d95f4e88b9fa432b48dc2.tar.gz
clang-a5f4441de7890953460d95f4e88b9fa432b48dc2.tar.bz2
clang-a5f4441de7890953460d95f4e88b9fa432b48dc2.tar.xz
[Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators instead of
ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use even if the caller did not check that the interface is a definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclObjC.h')
-rw-r--r--include/clang/AST/DeclObjC.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index 6aad5d0823..37a2e9ff8b 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -651,6 +651,7 @@ public:
void setExternallyCompleted();
const ObjCProtocolList &getReferencedProtocols() const {
+ assert(hasDefinition() && "Caller did not check for forward reference!");
if (data().ExternallyCompleted)
LoadExternalDefinition();