r196103 - Using the proper set key when determining whether a SubsetSubject helper method has been previously generated.

Aaron Ballman aaron at aaronballman.com
Mon Dec 2 06:58:17 PST 2013


Author: aaronballman
Date: Mon Dec  2 08:58:17 2013
New Revision: 196103

URL: http://llvm.org/viewvc/llvm-project?rev=196103&view=rev
Log:
Using the proper set key when determining whether a SubsetSubject helper method has been previously generated.

Modified:
    cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp

Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=196103&r1=196102&r2=196103&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Mon Dec  2 08:58:17 2013
@@ -1809,10 +1809,12 @@ static std::string CalculateDiagnostic(c
 
 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 GenerateCustomApperta
     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();





More information about the cfe-commits mailing list