mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
#include "llvm/ADT/DenseSet.h"
|
#include "llvm/ADT/DenseSet.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@@ -68,8 +67,8 @@ static void EmitAllCaps(std::ostream& OS, const std::string &s) {
|
|||||||
// Warning Tables (.inc file) generation.
|
// Warning Tables (.inc file) generation.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
static void ProcessDiag(std::ostream& OS, const Record* DiagClass,
|
static void ProcessDiag(std::ostream &OS, const Record *DiagClass,
|
||||||
const Record& R) {
|
const Record &R) {
|
||||||
|
|
||||||
const Record* DiagKind = getDiagKind(DiagClass, R);
|
const Record* DiagKind = getDiagKind(DiagClass, R);
|
||||||
if (!DiagKind)
|
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) {
|
for (RecordVector::const_iterator I=Diags.begin(), E=Diags.end(); I!=E; ++I) {
|
||||||
if (!Component.empty()) {
|
const Record &R = **I;
|
||||||
const RecordVal* V = findRecordVal(**I, "Component");
|
// Filter by component.
|
||||||
if (!V)
|
if (!Component.empty() && Component != R.getValueAsString("Component"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const StringInit* SV = dynamic_cast<const StringInit*>(V->getValue());
|
|
||||||
if (!SV || SV->getValue() != 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
|
// If an Option includes another Option, inline the Diagnostics of the
|
||||||
// included Option.
|
// included Option.
|
||||||
if (Def->isSubClassOf("Option")) {
|
if (Def->isSubClassOf("Option")) {
|
||||||
if (const RecordVal* V = findRecordVal(*Def, "Members"))
|
if (const RecordVal *V = findRecordVal(*Def, "Members"))
|
||||||
if (const ListInit* LV = dynamic_cast<const ListInit*>(V->getValue()))
|
if (const ListInit *LV = dynamic_cast<const ListInit*>(V->getValue()))
|
||||||
BuildGroup(DS, Visited, LV);
|
BuildGroup(DS, Visited, LV);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -192,10 +186,10 @@ static void BuildGroup(DiagnosticSet& DS, VisitedLists &Visited,
|
|||||||
|
|
||||||
void ClangOptionsEmitter::run(std::ostream &OS) {
|
void ClangOptionsEmitter::run(std::ostream &OS) {
|
||||||
// Build up a map from options to controlled diagnostics.
|
// Build up a map from options to controlled diagnostics.
|
||||||
OptionMap OM;
|
OptionMap OM;
|
||||||
|
|
||||||
const RecordVector &Opts = Records.getAllDerivedDefinitions("Option");
|
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 RecordVal* V = findRecordVal(**I, "Members"))
|
||||||
if (const ListInit* LV = dynamic_cast<const ListInit*>(V->getValue())) {
|
if (const ListInit* LV = dynamic_cast<const ListInit*>(V->getValue())) {
|
||||||
VisitedLists Visited;
|
VisitedLists Visited;
|
||||||
|
Reference in New Issue
Block a user