summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-08-28 04:02:50 +0000
committerCraig Topper <craig.topper@gmail.com>2013-08-28 04:02:50 +0000
commitd80c17e06022b89a97d1264526af5770b5057875 (patch)
treed3bfc5044997ee6a453227e95220a1241a9d53ed /clang/lib/Basic
parent19675898da07089a3d2f28716353e2c8a353d8a4 (diff)
downloadbcm5719-llvm-d80c17e06022b89a97d1264526af5770b5057875.tar.gz
bcm5719-llvm-d80c17e06022b89a97d1264526af5770b5057875.zip
Merge diagnostic group tables to reduce data size and relocation entries.
The individual group and subgroups tables are now two large tables. The option table stores an index into these two tables instead of pointers. This reduces the size of the options tabe since it doesn't need to store pointers. It also reduces the number of relocations needed. My build shows this reducing DiagnosticsIDs.o and the clang binary by ~20.5K. It also removes ~400 relocation entries from DiagnosticIDs.o. llvm-svn: 189438
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/DiagnosticIDs.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index 31e5e6a7417..9741f38684d 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -507,8 +507,8 @@ struct clang::WarningOption {
// shorter type anyway.
size_t NameLen;
const char *NameStr;
- const short *Members;
- const short *SubGroups;
+ uint16_t Members;
+ uint16_t SubGroups;
StringRef getName() const {
return StringRef(NameStr, NameLen);
@@ -545,16 +545,14 @@ void DiagnosticIDs::getDiagnosticsInGroup(
const WarningOption *Group,
SmallVectorImpl<diag::kind> &Diags) const {
// Add the members of the option diagnostic set.
- if (const short *Member = Group->Members) {
- for (; *Member != -1; ++Member)
- Diags.push_back(*Member);
- }
+ const int16_t *Member = DiagArrays + Group->Members;
+ for (; *Member != -1; ++Member)
+ Diags.push_back(*Member);
// Add the members of the subgroups.
- if (const short *SubGroups = Group->SubGroups) {
- for (; *SubGroups != (short)-1; ++SubGroups)
- getDiagnosticsInGroup(&OptionTable[(short)*SubGroups], Diags);
- }
+ const int16_t *SubGroups = DiagSubGroups + Group->SubGroups;
+ for (; *SubGroups != (int16_t)-1; ++SubGroups)
+ getDiagnosticsInGroup(&OptionTable[(short)*SubGroups], Diags);
}
bool DiagnosticIDs::getDiagnosticsInGroup(
OpenPOWER on IntegriCloud