r217781 - Adding some FIXMEs to the attribute emitter code regarding whether pretty printing enumerators should use quoted string literals, or identifiers. NFC.

Aaron Ballman aaron at aaronballman.com
Mon Sep 15 09:16:14 PDT 2014


Author: aaronballman
Date: Mon Sep 15 11:16:14 2014
New Revision: 217781

URL: http://llvm.org/viewvc/llvm-project?rev=217781&view=rev
Log:
Adding some FIXMEs to the attribute emitter code regarding whether pretty printing enumerators should use quoted string literals, or identifiers. NFC.

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=217781&r1=217780&r2=217781&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Mon Sep 15 11:16:14 2014
@@ -684,6 +684,9 @@ namespace {
       OS << "Record.push_back(SA->get" << getUpperName() << "());\n";
     }
     void writeValue(raw_ostream &OS) const override {
+      // FIXME: this isn't 100% correct -- some enum arguments require printing
+      // as a string literal, while others require printing as an identifier.
+      // Tablegen currently does not distinguish between the two forms.
       OS << "\\\"\" << " << getAttrName() << "Attr::Convert" << type << "ToStr(get"
          << getUpperName() << "()) << \"\\\"";
     }
@@ -737,6 +740,9 @@ namespace {
 
   protected:
     void writeValueImpl(raw_ostream &OS) const override {
+      // FIXME: this isn't 100% correct -- some enum arguments require printing
+      // as a string literal, while others require printing as an identifier.
+      // Tablegen currently does not distinguish between the two forms.
       OS << "    OS << \"\\\"\" << " << getAttrName() << "Attr::Convert" << type
          << "ToStr(Val)" << "<< \"\\\"\";\n";
     }





More information about the cfe-commits mailing list