diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-15 06:26:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-15 06:26:49 +0000 |
commit | 188375293a8631eec88a6a3788362d1962e932c3 (patch) | |
tree | 427c851567b959f66ac4f162665ea02ef2609062 /utils | |
parent | a899d239f67485170ee8d5210352da473dbd4c86 (diff) | |
download | external_llvm-188375293a8631eec88a6a3788362d1962e932c3.zip external_llvm-188375293a8631eec88a6a3788362d1962e932c3.tar.gz external_llvm-188375293a8631eec88a6a3788362d1962e932c3.tar.bz2 |
minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 5364f59..fb7a1c4 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -20,7 +20,6 @@ #include "llvm/ADT/DenseSet.h" #include <set> #include <map> - using namespace llvm; //===----------------------------------------------------------------------===// @@ -68,8 +67,8 @@ static void EmitAllCaps(std::ostream& OS, const std::string &s) { // Warning Tables (.inc file) generation. //===----------------------------------------------------------------------===// -static void ProcessDiag(std::ostream& OS, const Record* DiagClass, - const Record& R) { +static void ProcessDiag(std::ostream &OS, const Record *DiagClass, + const Record &R) { const Record* DiagKind = getDiagKind(DiagClass, R); if (!DiagKind) @@ -107,17 +106,12 @@ void ClangDiagsDefsEmitter::run(std::ostream &OS) { } for (RecordVector::const_iterator I=Diags.begin(), E=Diags.end(); I!=E; ++I) { - if (!Component.empty()) { - const RecordVal* V = findRecordVal(**I, "Component"); - if (!V) - continue; - - const StringInit* SV = dynamic_cast<const StringInit*>(V->getValue()); - if (!SV || SV->getValue() != Component) - continue; - } + const Record &R = **I; + // Filter by component. + if (!Component.empty() && Component != R.getValueAsString("Component")) + continue; - ProcessDiag(OS, DiagClass, **I); + ProcessDiag(OS, DiagClass, R); } } @@ -169,8 +163,8 @@ static void BuildGroup(DiagnosticSet& DS, VisitedLists &Visited, // If an Option includes another Option, inline the Diagnostics of the // included Option. if (Def->isSubClassOf("Option")) { - if (const RecordVal* V = findRecordVal(*Def, "Members")) - if (const ListInit* LV = dynamic_cast<const ListInit*>(V->getValue())) + if (const RecordVal *V = findRecordVal(*Def, "Members")) + if (const ListInit *LV = dynamic_cast<const ListInit*>(V->getValue())) BuildGroup(DS, Visited, LV); return; @@ -192,10 +186,10 @@ static void BuildGroup(DiagnosticSet& DS, VisitedLists &Visited, void ClangOptionsEmitter::run(std::ostream &OS) { // Build up a map from options to controlled diagnostics. - OptionMap OM; + OptionMap OM; const RecordVector &Opts = Records.getAllDerivedDefinitions("Option"); - for (RecordVector::const_iterator I=Opts.begin(), E=Opts.end(); I!=E; ++I) + for (RecordVector::const_iterator I=Opts.begin(), E=Opts.end(); I != E; ++I) if (const RecordVal* V = findRecordVal(**I, "Members")) if (const ListInit* LV = dynamic_cast<const ListInit*>(V->getValue())) { VisitedLists Visited; |