Using the proper set key when determining whether a SubsetSubject helper method has...
authorAaron Ballman <aaron@aaronballman.com>
Mon, 2 Dec 2013 14:58:17 +0000 (14:58 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 2 Dec 2013 14:58:17 +0000 (14:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196103 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/ClangAttrEmitter.cpp

index af0693a2ca0df2863be986bbca37d115ff93e0d6..08bcb501a8de5c7f09aadec2d5335543f5cd825b 100644 (file)
@@ -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<std::string> CustomSubjectSet;
-  std::set<std::string>::iterator I = CustomSubjectSet.find(Subject.getName());
+  std::set<std::string>::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();