forked from OSchip/llvm-project
Stop abusing StringRef. Fixes the Windows build.
I've also removed the duplicate check for PARSED_ATTR since it seems unnecessary, and would have made the code more complicated. llvm-svn: 158716
This commit is contained in:
parent
6bf4417261
commit
abc99d8d04
|
@ -966,7 +966,8 @@ void EmitClangAttrSpellingList(RecordKeeper &Records, raw_ostream &OS) {
|
|||
std::vector<Record*> Spellings = Attr.getValueAsListOfDefs("Spellings");
|
||||
|
||||
for (std::vector<Record*>::const_iterator I = Spellings.begin(), E = Spellings.end(); I != E; ++I) {
|
||||
StringRef Spelling = (*I)->getValueAsString("Name");
|
||||
SmallString<64> Spelling;
|
||||
Spelling += (*I)->getValueAsString("Name");
|
||||
OS << ".Case(\"" << Spelling << "\", true)\n";
|
||||
}
|
||||
}
|
||||
|
@ -1074,6 +1075,9 @@ void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) {
|
|||
<< "} // end namespace clang\n";
|
||||
}
|
||||
|
||||
}
|
||||
#include <cstdio>
|
||||
namespace clang {
|
||||
// Emits the list of parsed attributes.
|
||||
void EmitClangAttrParsedAttrList(RecordKeeper &Records, raw_ostream &OS) {
|
||||
OS << "// This file is generated by TableGen. Do not edit.\n\n";
|
||||
|
@ -1083,7 +1087,6 @@ void EmitClangAttrParsedAttrList(RecordKeeper &Records, raw_ostream &OS) {
|
|||
OS << "#endif\n\n";
|
||||
|
||||
std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
|
||||
std::set<StringRef> ProcessedAttrs;
|
||||
|
||||
for (std::vector<Record*>::iterator I = Attrs.begin(), E = Attrs.end();
|
||||
I != E; ++I) {
|
||||
|
@ -1098,16 +1101,12 @@ void EmitClangAttrParsedAttrList(RecordKeeper &Records, raw_ostream &OS) {
|
|||
|
||||
for (std::vector<Record*>::const_iterator I = Spellings.begin(),
|
||||
E = Spellings.end(); I != E; ++I) {
|
||||
StringRef AttrName = (*I)->getValueAsString("Name");
|
||||
SmallString<64> AttrName;
|
||||
AttrName += (*I)->getValueAsString("Name");
|
||||
|
||||
AttrName = NormalizeAttrName(AttrName);
|
||||
// skip if a normalized version has been processed.
|
||||
if (ProcessedAttrs.find(AttrName) != ProcessedAttrs.end())
|
||||
continue;
|
||||
else
|
||||
ProcessedAttrs.insert(AttrName);
|
||||
StringRef Spelling = NormalizeAttrName(AttrName);
|
||||
|
||||
OS << "PARSED_ATTR(" << AttrName << ")\n";
|
||||
OS << "PARSED_ATTR(" << Spelling << ")\n";
|
||||
}
|
||||
} else {
|
||||
StringRef AttrName = Attr.getName();
|
||||
|
@ -1138,9 +1137,10 @@ void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) {
|
|||
|
||||
for (std::vector<Record*>::const_iterator I = Spellings.begin(),
|
||||
E = Spellings.end(); I != E; ++I) {
|
||||
StringRef RawSpelling = (*I)->getValueAsString("Name");
|
||||
SmallString<64> RawSpelling;
|
||||
RawSpelling += (*I)->getValueAsString("Name");
|
||||
StringRef AttrName = NormalizeAttrName(DistinctSpellings
|
||||
? RawSpelling
|
||||
? StringRef(RawSpelling)
|
||||
: StringRef(Attr.getName()));
|
||||
|
||||
SmallString<64> Spelling;
|
||||
|
|
Loading…
Reference in New Issue