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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aaron Ballman 2014-09-15 16:16:14 +00:00
parent 663b4dd44e
commit 6eb5757e25
1 changed files with 6 additions and 0 deletions

View File

@ -684,6 +684,9 @@ namespace {
OS << "Record.push_back(SA->get" << getUpperName() << "());\n"; OS << "Record.push_back(SA->get" << getUpperName() << "());\n";
} }
void writeValue(raw_ostream &OS) const override { 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" OS << "\\\"\" << " << getAttrName() << "Attr::Convert" << type << "ToStr(get"
<< getUpperName() << "()) << \"\\\""; << getUpperName() << "()) << \"\\\"";
} }
@ -737,6 +740,9 @@ namespace {
protected: protected:
void writeValueImpl(raw_ostream &OS) const override { 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 OS << " OS << \"\\\"\" << " << getAttrName() << "Attr::Convert" << type
<< "ToStr(Val)" << "<< \"\\\"\";\n"; << "ToStr(Val)" << "<< \"\\\"\";\n";
} }