From: Aaron Ballman Date: Mon, 2 Dec 2013 14:58:17 +0000 (+0000) Subject: Using the proper set key when determining whether a SubsetSubject helper method has... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b6a8c4b077c70c3e6bb7a722bed0577f643d9b9;p=clang Using the proper set key when determining whether a SubsetSubject helper method has been previously generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196103 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index af0693a2ca..08bcb501a8 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -1809,10 +1809,12 @@ static std::string CalculateDiagnostic(const Record &S) { static std::string GenerateCustomAppertainsTo(const Record &Subject, raw_ostream &OS) { + std::string FnName = "is" + Subject.getName(); + // If this code has already been generated, simply return the previous // instance of it. static std::set CustomSubjectSet; - std::set::iterator I = CustomSubjectSet.find(Subject.getName()); + std::set::iterator I = CustomSubjectSet.find(FnName); if (I != CustomSubjectSet.end()) return *I; @@ -1825,7 +1827,6 @@ static std::string GenerateCustomAppertainsTo(const Record &Subject, return ""; } - std::string FnName = "is" + Subject.getName(); OS << "static bool " << FnName << "(const Decl *D) {\n"; OS << " const " << Base->getName() << "Decl *S = dyn_cast<"; OS << Base->getName();