[libc-commits] [libc] 881402c - [libc][NFC] Eliminate couple of dependencies on llvm/ADT/StringExtras.h.
Siva Chandra Reddy via libc-commits
libc-commits at lists.llvm.org
Mon Feb 22 21:42:32 PST 2021
Author: Siva Chandra Reddy
Date: 2021-02-22T21:41:24-08:00
New Revision: 881402ce62f7dbcf9704787b5d5d3ed691a30730
URL: https://github.com/llvm/llvm-project/commit/881402ce62f7dbcf9704787b5d5d3ed691a30730
DIFF: https://github.com/llvm/llvm-project/commit/881402ce62f7dbcf9704787b5d5d3ed691a30730.diff
LOG: [libc][NFC] Eliminate couple of dependencies on llvm/ADT/StringExtras.h.
Added:
Modified:
libc/utils/FPUtil/TestHelpers.cpp
libc/utils/MPFRWrapper/MPFRUtils.cpp
Removed:
################################################################################
diff --git a/libc/utils/FPUtil/TestHelpers.cpp b/libc/utils/FPUtil/TestHelpers.cpp
index 189efe6a0bd1..71566ef99cf1 100644
--- a/libc/utils/FPUtil/TestHelpers.cpp
+++ b/libc/utils/FPUtil/TestHelpers.cpp
@@ -10,8 +10,6 @@
#include "FPBits.h"
-#include "llvm/ADT/StringExtras.h"
-
#include <string>
namespace __llvm_libc {
@@ -26,7 +24,7 @@ uintToHex(T X, size_t Length = sizeof(T) * 2) {
for (auto it = s.rbegin(), end = s.rend(); it != end; ++it, X >>= 4) {
unsigned char Mod = static_cast<unsigned char>(X) & 15;
- *it = llvm::hexdigit(Mod, true);
+ *it = (Mod < 10 ? '0' + Mod : 'a' + Mod - 10);
}
return s;
diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index 7cc80a281c6e..79e7379133e2 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -11,7 +11,6 @@
#include "utils/FPUtil/FPBits.h"
#include "utils/FPUtil/TestHelpers.h"
-#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include <memory>
More information about the libc-commits
mailing list