diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-10-23 20:15:35 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-10-23 20:15:35 +0000 |
| commit | a9b3944c0e9f12032b635959c91467f799816585 (patch) | |
| tree | 6c11342b4e212052dafe428dfa3b173150819efd /llvm/lib/MC | |
| parent | 52f7b08b4a421123fca59e1b5010ec82a406f870 (diff) | |
| download | bcm5719-llvm-a9b3944c0e9f12032b635959c91467f799816585.tar.gz bcm5719-llvm-a9b3944c0e9f12032b635959c91467f799816585.zip | |
Fix the variable names to match the LLVM style.
llvm-svn: 251143
Diffstat (limited to 'llvm/lib/MC')
| -rw-r--r-- | llvm/lib/MC/StringTableBuilder.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/llvm/lib/MC/StringTableBuilder.cpp b/llvm/lib/MC/StringTableBuilder.cpp index cc4fbf66385..fc6c3bc0902 100644 --- a/llvm/lib/MC/StringTableBuilder.cpp +++ b/llvm/lib/MC/StringTableBuilder.cpp @@ -18,21 +18,21 @@ using namespace llvm; static int compareBySuffix(std::pair<StringRef, size_t> *const *AP, std::pair<StringRef, size_t> *const *BP) { - StringRef a = (*AP)->first; - StringRef b = (*BP)->first; - size_t sizeA = a.size(); - size_t sizeB = b.size(); - size_t len = std::min(sizeA, sizeB); - for (size_t i = 0; i < len; ++i) { - char ca = a[sizeA - i - 1]; - char cb = b[sizeB - i - 1]; - if (ca != cb) - return cb - ca; + StringRef A = (*AP)->first; + StringRef B = (*BP)->first; + size_t SizeA = A.size(); + size_t SizeB = B.size(); + size_t Len = std::min(SizeA, SizeB); + for (size_t I = 0; I < Len; ++I) { + char CA = A[SizeA - I - 1]; + char CB = B[SizeB - I - 1]; + if (CA != CB) + return CB - CA; } - return sizeB - sizeA; + return SizeB - SizeA; } -void StringTableBuilder::finalize(Kind kind) { +void StringTableBuilder::finalize(Kind K) { std::vector<std::pair<StringRef, size_t> *> Strings; Strings.reserve(StringIndexMap.size()); for (std::pair<StringRef, size_t> &P : StringIndexMap) @@ -40,7 +40,7 @@ void StringTableBuilder::finalize(Kind kind) { array_pod_sort(Strings.begin(), Strings.end(), compareBySuffix); - switch (kind) { + switch (K) { case ELF: case MachO: // Start the table with a NUL byte. @@ -54,22 +54,22 @@ void StringTableBuilder::finalize(Kind kind) { StringRef Previous; for (std::pair<StringRef, size_t> *P : Strings) { - StringRef s = P->first; - if (kind == WinCOFF) - assert(s.size() > COFF::NameSize && "Short string in COFF string table!"); + StringRef S = P->first; + if (K == WinCOFF) + assert(S.size() > COFF::NameSize && "Short string in COFF string table!"); - if (Previous.endswith(s)) { - P->second = StringTable.size() - 1 - s.size(); + if (Previous.endswith(S)) { + P->second = StringTable.size() - 1 - S.size(); continue; } P->second = StringTable.size(); - StringTable += s; + StringTable += S; StringTable += '\x00'; - Previous = s; + Previous = S; } - switch (kind) { + switch (K) { case ELF: break; case MachO: @@ -80,9 +80,9 @@ void StringTableBuilder::finalize(Kind kind) { case WinCOFF: // Write the table size in the first word. assert(StringTable.size() <= std::numeric_limits<uint32_t>::max()); - uint32_t size = static_cast<uint32_t>(StringTable.size()); + uint32_t Size = static_cast<uint32_t>(StringTable.size()); support::endian::write<uint32_t, support::little, support::unaligned>( - StringTable.data(), size); + StringTable.data(), Size); break; } } @@ -92,14 +92,14 @@ void StringTableBuilder::clear() { StringIndexMap.clear(); } -size_t StringTableBuilder::getOffset(StringRef s) const { +size_t StringTableBuilder::getOffset(StringRef S) const { assert(isFinalized()); - auto I = StringIndexMap.find(s); + auto I = StringIndexMap.find(S); assert(I != StringIndexMap.end() && "String is not in table!"); return I->second; } -void StringTableBuilder::add(StringRef s) { +void StringTableBuilder::add(StringRef S) { assert(!isFinalized()); - StringIndexMap.insert(std::make_pair(s, 0)); + StringIndexMap.insert(std::make_pair(S, 0)); } |

