summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-03 21:11:30 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-03 21:11:30 +0000
commit9ed9e5f31c1fe946a5c6c1ffb651052925570fd4 (patch)
tree605b946afd00d0cd5ed2e51a74d0b4a127aa8b0b /clang/lib/Sema/SemaDeclAttr.cpp
parentd1438b446e7463db7207720321e0bdf5fc6654ea (diff)
downloadbcm5719-llvm-9ed9e5f31c1fe946a5c6c1ffb651052925570fd4.tar.gz
bcm5719-llvm-9ed9e5f31c1fe946a5c6c1ffb651052925570fd4.zip
[objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get the
designated initializers of an interface. If the interface declaration does not have methods marked as designated initializers then the interface inherits the designated initializers of its super class. llvm-svn: 196315
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index b732fccacf8..c587452aeb4 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -3723,13 +3723,15 @@ static void handleObjCDesignatedInitializer(Sema &S, Decl *D,
<< SourceRange(Loc, Loc);
return;
}
- DeclContext *DC = Method->getDeclContext();
- if (!isa<ObjCInterfaceDecl>(DC)) {
+ ObjCInterfaceDecl *IFace =
+ dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext());
+ if (!IFace) {
S.Diag(D->getLocStart(), diag::err_attr_objc_designated_not_interface)
<< SourceRange(Loc, Loc);
return;
}
+ IFace->setHasDesignatedInitializers();
Method->addAttr(::new (S.Context)
ObjCDesignatedInitializerAttr(Attr.getRange(), S.Context,
Attr.getAttributeSpellingListIndex()));
OpenPOWER on IntegriCloud