diff options
Diffstat (limited to 'utils/TableGen/ClangAttrEmitter.cpp')
-rw-r--r-- | utils/TableGen/ClangAttrEmitter.cpp | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index 8a8987720e..abca58d578 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// -#include "ClangAttrEmitter.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/StringMatcher.h" +#include "llvm/TableGen/TableGenBackend.h" #include <algorithm> #include <cctype> #include <set> @@ -661,7 +661,10 @@ static void writeAvailabilityValue(raw_ostream &OS) { << " OS << \""; } -void ClangAttrClassEmitter::run(raw_ostream &OS) { +namespace clang { + +// Emits the class definitions for attributes. +void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n"; OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n"; @@ -750,7 +753,8 @@ void ClangAttrClassEmitter::run(raw_ostream &OS) { OS << "#endif\n"; } -void ClangAttrImplEmitter::run(raw_ostream &OS) { +// Emits the class method definitions for attributes. +void EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"); @@ -801,6 +805,8 @@ void ClangAttrImplEmitter::run(raw_ostream &OS) { } } +} // end namespace clang + static void EmitAttrList(raw_ostream &OS, StringRef Class, const std::vector<Record*> &AttrList) { std::vector<Record*>::const_iterator i = AttrList.begin(), e = AttrList.end(); @@ -818,7 +824,10 @@ static void EmitAttrList(raw_ostream &OS, StringRef Class, } } -void ClangAttrListEmitter::run(raw_ostream &OS) { +namespace clang { + +// Emits the enumeration list for attributes. +void EmitClangAttrList(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; OS << "#ifndef LAST_ATTR\n"; @@ -870,7 +879,8 @@ void ClangAttrListEmitter::run(raw_ostream &OS) { OS << "#undef ATTR\n"; } -void ClangAttrPCHReadEmitter::run(raw_ostream &OS) { +// Emits the code to read an attribute from a precompiled header. +void EmitClangAttrPCHRead(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; Record *InhClass = Records.getClass("InheritableAttr"); @@ -913,7 +923,8 @@ void ClangAttrPCHReadEmitter::run(raw_ostream &OS) { OS << " }\n"; } -void ClangAttrPCHWriteEmitter::run(raw_ostream &OS) { +// Emits the code to write an attribute to a precompiled header. +void EmitClangAttrPCHWrite(RecordKeeper &Records, raw_ostream &OS) { Record *InhClass = Records.getClass("InheritableAttr"); std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"), Args; std::vector<Record*>::iterator i = Attrs.begin(), e = Attrs.end(), ai, ae; @@ -941,7 +952,8 @@ void ClangAttrPCHWriteEmitter::run(raw_ostream &OS) { OS << " }\n"; } -void ClangAttrSpellingListEmitter::run(raw_ostream &OS) { +// Emits the list of spellings for attributes. +void EmitClangAttrSpellingList(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"); @@ -959,7 +971,8 @@ void ClangAttrSpellingListEmitter::run(raw_ostream &OS) { } -void ClangAttrLateParsedListEmitter::run(raw_ostream &OS) { +// Emits the LateParsed property for attributes. +void EmitClangAttrLateParsedList(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"); @@ -982,8 +995,8 @@ void ClangAttrLateParsedListEmitter::run(raw_ostream &OS) { } } - -void ClangAttrTemplateInstantiateEmitter::run(raw_ostream &OS) { +// Emits code to instantiate dependent attributes on templates. +void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"); @@ -1055,7 +1068,8 @@ void ClangAttrTemplateInstantiateEmitter::run(raw_ostream &OS) { << "} // end namespace clang\n"; } -void ClangAttrParsedAttrListEmitter::run(raw_ostream &OS) { +// 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"; OS << "#ifndef PARSED_ATTR\n"; @@ -1096,7 +1110,8 @@ void ClangAttrParsedAttrListEmitter::run(raw_ostream &OS) { } } -void ClangAttrParsedAttrKindsEmitter::run(raw_ostream &OS) { +// Emits the kind list of parsed attributes +void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; OS << "\n"; @@ -1141,4 +1156,4 @@ void ClangAttrParsedAttrKindsEmitter::run(raw_ostream &OS) { << "}\n"; } - +} // end namespace clang |