r201518 - The default assignment operator could not be generated by all of the bots, but it's required by std::vector to operate properly.

Aaron Ballman aaron at aaronballman.com
Mon Feb 17 08:18:32 PST 2014


Author: aaronballman
Date: Mon Feb 17 10:18:32 2014
New Revision: 201518

URL: http://llvm.org/viewvc/llvm-project?rev=201518&view=rev
Log:
The default assignment operator could not be generated by all of the bots, but it's required by std::vector to operate properly.

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=201518&r1=201517&r2=201518&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Mon Feb 17 10:18:32 2014
@@ -2645,13 +2645,13 @@ public:
   };
 
   DocCategory Category;
-  const Record &Documentation;
-  const Record &Attribute;
+  const Record *Documentation;
+  const Record *Attribute;
 
   DocumentationData(DocCategory Category, const Record &Documentation,
                     const Record &Attribute)
-      : Category(Category), Documentation(Documentation), Attribute(Attribute) {
-  }
+      : Category(Category), Documentation(&Documentation),
+        Attribute(&Attribute) {}
 };
 
 static void WriteCategoryHeader(DocumentationData::DocCategory Category,
@@ -2690,10 +2690,10 @@ static void WriteDocumentation(const Doc
   // documentation. This may not be a limiting factor since the spellings
   // should generally be consistently applied across the category.
 
-  std::vector<FlattenedSpelling> Spellings = GetFlattenedSpellings(Doc.Attribute);
+  std::vector<FlattenedSpelling> Spellings = GetFlattenedSpellings(*Doc.Attribute);
 
   // Determine the heading to be used for this attribute.
-  std::string Heading = Doc.Documentation.getValueAsString("Heading");
+  std::string Heading = Doc.Documentation->getValueAsString("Heading");
   if (Heading.empty()) {
     // If there's only one spelling, we can simply use that.
     if (Spellings.size() == 1)
@@ -2714,7 +2714,7 @@ static void WriteDocumentation(const Doc
 
   // If the heading is still empty, it is an error.
   if (Heading.empty())
-    PrintFatalError(Doc.Attribute.getLoc(),
+    PrintFatalError(Doc.Attribute->getLoc(),
                     "This attribute requires a heading to be specified");
 
   // Gather a list of unique spellings; this is not the same as the semantic
@@ -2759,7 +2759,7 @@ static void WriteDocumentation(const Doc
   OS << Heading << "\n" << std::string(Heading.length(), '-') << "\n";
 
   if (!SupportedSpellings)
-    PrintFatalError(Doc.Attribute.getLoc(),
+    PrintFatalError(Doc.Attribute->getLoc(),
                     "Attribute has no supported spellings; cannot be "
                     "documented");
 
@@ -2778,10 +2778,10 @@ static void WriteDocumentation(const Doc
 
   // If the attribute is deprecated, print a message about it, and possibly
   // provide a replacement attribute.
-  if (!Doc.Documentation.isValueUnset("Deprecated")) {
+  if (!Doc.Documentation->isValueUnset("Deprecated")) {
     OS << "This attribute has been deprecated, and may be removed in a future "
        << "version of Clang.";
-    const Record &Deprecated = *Doc.Documentation.getValueAsDef("Deprecated");
+    const Record &Deprecated = *Doc.Documentation->getValueAsDef("Deprecated");
     std::string Replacement = Deprecated.getValueAsString("Replacement");
     if (!Replacement.empty())
       OS << "  This attribute has been superseded by ``"
@@ -2789,7 +2789,7 @@ static void WriteDocumentation(const Doc
     OS << "\n\n";
   }
 
-  std::string ContentStr = Doc.Documentation.getValueAsString("Content");
+  std::string ContentStr = Doc.Documentation->getValueAsString("Content");
   // Trim leading and trailing newlines and spaces.
   StringRef Content(ContentStr);
   while (Content.startswith("\r") || Content.startswith("\n") ||





More information about the cfe-commits mailing list