Fixes a possible assert in the custom SubsetSubject logic for the attr emitter.

llvm-svn: 195962
This commit is contained in:
Aaron Ballman 2013-11-29 16:12:29 +00:00
parent cabdd738fc
commit 4cfafb9a85
1 changed files with 3 additions and 2 deletions

View File

@ -1827,9 +1827,10 @@ static std::string GenerateCustomAppertainsTo(const Record &Subject,
std::string FnName = "is" + Subject.getName();
OS << "static bool " << FnName << "(const Decl *D) {\n";
OS << " const " << Base->getName() << "Decl *S = cast<" << Base->getName();
OS << " const " << Base->getName() << "Decl *S = dyn_cast<";
OS << Base->getName();
OS << "Decl>(D);\n";
OS << " return " << Subject.getValueAsString("CheckCode") << ";\n";
OS << " return S && " << Subject.getValueAsString("CheckCode") << ";\n";
OS << "}\n\n";
CustomSubjectSet.insert(FnName);