summaryrefslogtreecommitdiff
path: root/utils/TableGen/ClangDiagnosticsEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-15 20:16:12 +0000
committerChris Lattner <sabre@nondot.org>2009-04-15 20:16:12 +0000
commit9371c33611d42e15ef722e443f0d250f4b84e910 (patch)
treea4b25ec607b08a06d12a0007bc1e8a959fe91013 /utils/TableGen/ClangDiagnosticsEmitter.cpp
parent457cde4d45816b3db7649c5faabd70a524963b1f (diff)
downloadllvm-9371c33611d42e15ef722e443f0d250f4b84e910.tar.gz
llvm-9371c33611d42e15ef722e443f0d250f4b84e910.tar.bz2
llvm-9371c33611d42e15ef722e443f0d250f4b84e910.tar.xz
use UppercaseString instead of EmitAllCaps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/ClangDiagnosticsEmitter.cpp')
-rw-r--r--utils/TableGen/ClangDiagnosticsEmitter.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp
index 5a5f4795c2..1588f0b636 100644
--- a/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -28,10 +28,9 @@ using namespace llvm;
//===----------------------------------------------------------------------===//
typedef std::vector<Record*> RecordVector;
-typedef std::vector<Record*> SuperClassVector;
-typedef std::vector<RecordVal> RecordValVector;
static const RecordVal* findRecordVal(const Record& R, const std::string &key) {
+ typedef std::vector<RecordVal> RecordValVector;
const RecordValVector &Vals = R.getValues();
for (RecordValVector::const_iterator I=Vals.begin(), E=Vals.end(); I!=E; ++I)
if ((*I).getName() == key)
@@ -40,11 +39,6 @@ static const RecordVal* findRecordVal(const Record& R, const std::string &key) {
return 0;
}
-static void EmitAllCaps(std::ostream& OS, const std::string &s) {
- for (std::string::const_iterator I=s.begin(), E=s.end(); I!=E; ++I)
- OS << char(toupper(*I));
-}
-
//===----------------------------------------------------------------------===//
// Warning Tables (.inc file) generation.
//===----------------------------------------------------------------------===//
@@ -68,15 +62,12 @@ void ClangDiagsDefsEmitter::run(std::ostream &OS) {
// Write the #if guard
if (!Component.empty()) {
- OS << "#ifdef ";
- EmitAllCaps(OS, Component);
- OS << "START\n__";
- EmitAllCaps(OS, Component);
- OS << "START = DIAG_START_";
- EmitAllCaps(OS, Component);
- OS << ",\n#undef ";
- EmitAllCaps(OS, Component);
- OS << "START\n#endif\n";
+ std::string ComponentName = UppercaseString(Component);
+ OS << "#ifdef " << ComponentName << "START\n";
+ OS << "__" << ComponentName << "START = DIAG_START_" << ComponentName
+ << ",\n";
+ OS << "#undef " << ComponentName << "START\n";
+ OS << "#endif\n";
}
for (RecordVector::const_iterator I=Diags.begin(), E=Diags.end(); I!=E; ++I) {