mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-21 02:29:22 +00:00
'tblgen -gen-clang-diags-options' now outputs the OptionTable:
static const WarningOption OptionTable[] = { {"unused-macros", DIAGS(UnusedMacrosDiags)} ... }; This table is not yet properly sorted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67242 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b9d027701
commit
3ac82fe490
@ -186,11 +186,6 @@ void ClangOptionsEmitter::run(std::ostream &OS) {
|
|||||||
|
|
||||||
// Iterate through the OptionMap and emit the declarations.
|
// Iterate through the OptionMap and emit the declarations.
|
||||||
for (OptionMap::iterator I = OM.begin(), E = OM.end(); I!=E; ++I) {
|
for (OptionMap::iterator I = OM.begin(), E = OM.end(); I!=E; ++I) {
|
||||||
// const RecordVal *V = findRecordVal(*I->first, "Name");
|
|
||||||
// assert(V && "Options must have a 'Name' value.");
|
|
||||||
// const StringInit* SV = dynamic_cast<const StringInit*>(V->getValue());
|
|
||||||
// assert(SV && "'Name' entry must be a string.");
|
|
||||||
|
|
||||||
// Output the option.
|
// Output the option.
|
||||||
OS << "static const diag::kind " << I->first->getName() << "[] = { ";
|
OS << "static const diag::kind " << I->first->getName() << "[] = { ";
|
||||||
|
|
||||||
@ -206,4 +201,23 @@ void ClangOptionsEmitter::run(std::ostream &OS) {
|
|||||||
}
|
}
|
||||||
OS << " };\n";
|
OS << " };\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now emit the OptionTable table.
|
||||||
|
OS << "\nstatic const WarningOption OptionTable[] = {";
|
||||||
|
bool first = true;
|
||||||
|
for (OptionMap::iterator I = OM.begin(), E = OM.end(); I!=E; ++I) {
|
||||||
|
const RecordVal *V = findRecordVal(*I->first, "Name");
|
||||||
|
assert(V && "Options must have a 'Name' value.");
|
||||||
|
const StringInit* SV = dynamic_cast<const StringInit*>(V->getValue());
|
||||||
|
assert(SV && "'Name' entry must be a string.");
|
||||||
|
|
||||||
|
if (first)
|
||||||
|
first = false;
|
||||||
|
else
|
||||||
|
OS << ',';
|
||||||
|
|
||||||
|
OS << "\n {\"" << SV->getValue()
|
||||||
|
<< "\", DIAGS(" << I->first->getName() << ")}";
|
||||||
|
}
|
||||||
|
OS << "\n};\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user