summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-19 02:25:16 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-19 02:25:16 +0000
commit4e8b13613bd1573ad02585378227e7ef0e65c50c (patch)
treeee945fc7999aa0759d649b74ac2377c1a11955bf
parenta737ba55af89e752ab95300309d8c4df2cf6de15 (diff)
downloadbcm5719-llvm-4e8b13613bd1573ad02585378227e7ef0e65c50c.tar.gz
bcm5719-llvm-4e8b13613bd1573ad02585378227e7ef0e65c50c.zip
Don't forget to complete the objc interface before asking for information,
otherwise lldb will suffer. llvm-svn: 142471
-rw-r--r--clang/lib/AST/DeclObjC.cpp9
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
2 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 0481f9cdf5d..7eb2688134b 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -237,6 +237,9 @@ const ObjCCategoryDecl* ObjCCategoryDecl::getNextClassExtension() const {
ObjCIvarDecl *ObjCInterfaceDecl::lookupInstanceVariable(IdentifierInfo *ID,
ObjCInterfaceDecl *&clsDeclared) {
+ if (ExternallyCompleted)
+ LoadExternalDefinition();
+
ObjCInterfaceDecl* ClassDecl = this;
while (ClassDecl != NULL) {
if (ObjCIvarDecl *I = ClassDecl->getIvarDecl(ID)) {
@@ -261,6 +264,9 @@ ObjCIvarDecl *ObjCInterfaceDecl::lookupInstanceVariable(IdentifierInfo *ID,
/// the it returns NULL.
ObjCInterfaceDecl *ObjCInterfaceDecl::lookupInheritedClass(
const IdentifierInfo*ICName) {
+ if (ExternallyCompleted)
+ LoadExternalDefinition();
+
ObjCInterfaceDecl* ClassDecl = this;
while (ClassDecl != NULL) {
if (ClassDecl->getIdentifier() == ICName)
@@ -315,6 +321,9 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel,
ObjCMethodDecl *ObjCInterfaceDecl::lookupPrivateMethod(
const Selector &Sel,
bool Instance) {
+ if (ExternallyCompleted)
+ LoadExternalDefinition();
+
ObjCMethodDecl *Method = 0;
if (ObjCImplementationDecl *ImpDecl = getImplementation())
Method = Instance ? ImpDecl->getInstanceMethod(Sel)
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 47c8f540e47..3b4a40b51ab 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1934,7 +1934,8 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
if (LookForIvars) {
IFace = CurMethod->getClassInterface();
ObjCInterfaceDecl *ClassDeclared;
- if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(II, ClassDeclared)) {
+ ObjCIvarDecl *IV = 0;
+ if (IFace && (IV = IFace->lookupInstanceVariable(II, ClassDeclared))) {
// Diagnose using an ivar in a class method.
if (IsClassMethod)
return ExprError(Diag(Loc, diag::error_ivar_use_in_class_method)
OpenPOWER on IntegriCloud