summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-08-27 05:25:25 +0000
committerCraig Topper <craig.topper@gmail.com>2014-08-27 05:25:25 +0000
commite1d1294853f88f663639f0d5582eec5b0ad8f9ff (patch)
tree5bd7b736dc5a2637df5b1cf458986af8e40915ff /llvm/lib/Support
parent3af97225291fe0c74ece7e15d6b45773a2a60007 (diff)
downloadbcm5719-llvm-e1d1294853f88f663639f0d5582eec5b0ad8f9ff.tar.gz
bcm5719-llvm-e1d1294853f88f663639f0d5582eec5b0ad8f9ff.zip
Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.
llvm-svn: 216525
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/MD5.cpp8
-rw-r--r--llvm/lib/Support/StringRef.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Support/MD5.cpp b/llvm/lib/Support/MD5.cpp
index 514466c750f..7aaf9a26264 100644
--- a/llvm/lib/Support/MD5.cpp
+++ b/llvm/lib/Support/MD5.cpp
@@ -208,11 +208,11 @@ void MD5::update(ArrayRef<uint8_t> Data) {
memcpy(&buffer[used], Ptr, free);
Ptr = Ptr + free;
Size -= free;
- body(ArrayRef<uint8_t>(buffer, 64));
+ body(makeArrayRef(buffer, 64));
}
if (Size >= 64) {
- Ptr = body(ArrayRef<uint8_t>(Ptr, Size & ~(unsigned long) 0x3f));
+ Ptr = body(makeArrayRef(Ptr, Size & ~(unsigned long) 0x3f));
Size &= 0x3f;
}
@@ -240,7 +240,7 @@ void MD5::final(MD5Result &result) {
if (free < 8) {
memset(&buffer[used], 0, free);
- body(ArrayRef<uint8_t>(buffer, 64));
+ body(makeArrayRef(buffer, 64));
used = 0;
free = 64;
}
@@ -257,7 +257,7 @@ void MD5::final(MD5Result &result) {
buffer[62] = hi >> 16;
buffer[63] = hi >> 24;
- body(ArrayRef<uint8_t>(buffer, 64));
+ body(makeArrayRef(buffer, 64));
result[0] = a;
result[1] = a >> 8;
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index 0da9d5fd3dc..ddece087a9e 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -105,8 +105,8 @@ unsigned StringRef::edit_distance(llvm::StringRef Other,
bool AllowReplacements,
unsigned MaxEditDistance) const {
return llvm::ComputeEditDistance(
- llvm::ArrayRef<char>(data(), size()),
- llvm::ArrayRef<char>(Other.data(), Other.size()),
+ makeArrayRef(data(), size()),
+ makeArrayRef(Other.data(), Other.size()),
AllowReplacements, MaxEditDistance);
}
OpenPOWER on IntegriCloud