forked from OSchip/llvm-project
Do not crash when dumping the objc_bridge_related attribute when its optional arguments are not supplied.
Patch thanks to Joe Ranieri! llvm-svn: 254303
This commit is contained in:
parent
33c95f08b0
commit
415c414bf2
|
@ -1087,8 +1087,8 @@ def ObjCBridgeRelated : InheritableAttr {
|
|||
let Spellings = [GNU<"objc_bridge_related">];
|
||||
let Subjects = SubjectList<[Record], ErrorDiag>;
|
||||
let Args = [IdentifierArgument<"RelatedClass">,
|
||||
IdentifierArgument<"ClassMethod">,
|
||||
IdentifierArgument<"InstanceMethod">];
|
||||
IdentifierArgument<"ClassMethod", 1>,
|
||||
IdentifierArgument<"InstanceMethod", 1>];
|
||||
let HasCustomParsing = 1;
|
||||
let Documentation = [Undocumented];
|
||||
}
|
||||
|
|
|
@ -150,3 +150,7 @@ void f() {
|
|||
// CHECK: DeprecatedAttr
|
||||
}
|
||||
}
|
||||
|
||||
struct __attribute__((objc_bridge_related(NSParagraphStyle,,))) TestBridgedRef;
|
||||
// CHECK: CXXRecordDecl{{.*}} struct TestBridgedRef
|
||||
// CHECK-NEXT: ObjCBridgeRelatedAttr{{.*}} NSParagraphStyle
|
||||
|
|
|
@ -279,6 +279,8 @@ namespace {
|
|||
OS << " OS << \" \";\n";
|
||||
OS << " dumpBareDeclRef(SA->get" << getUpperName() << "());\n";
|
||||
} else if (type == "IdentifierInfo *") {
|
||||
if (isOptional())
|
||||
OS << " if (SA->get" << getUpperName() << "())\n ";
|
||||
OS << " OS << \" \" << SA->get" << getUpperName()
|
||||
<< "()->getName();\n";
|
||||
} else if (type == "TypeSourceInfo *") {
|
||||
|
|
Loading…
Reference in New Issue