summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-08 22:30:11 +0000
committerZachary Turner <zturner@google.com>2016-11-08 22:30:11 +0000
commit44728f40146558c8f5b3e09ebbe2c245a5387512 (patch)
treed2e03bc5fe14a8e3e9d8f967cc45843393c46832 /llvm/lib/DebugInfo/CodeView
parent4efa0a4201c5df01817895f476dfac71b3064acc (diff)
downloadbcm5719-llvm-44728f40146558c8f5b3e09ebbe2c245a5387512.tar.gz
bcm5719-llvm-44728f40146558c8f5b3e09ebbe2c245a5387512.zip
Fix some size_t / uint32_t ambiguity errors.
llvm-svn: 286305
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView')
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp b/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
index f260ddad3fd..f46e08d5542 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
@@ -50,15 +50,15 @@ static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name,
// Try to be smart about what we write here. We can't write anything too
// large, so if we're going to go over the limit, truncate both the name
// and unique name by the same amount.
- uint32_t BytesLeft = IO.maxFieldLength();
+ size_t BytesLeft = IO.maxFieldLength();
if (HasUniqueName) {
- uint32_t BytesNeeded = Name.size() + UniqueName.size() + 2;
+ size_t BytesNeeded = Name.size() + UniqueName.size() + 2;
StringRef N = Name;
StringRef U = UniqueName;
if (BytesNeeded > BytesLeft) {
- uint32_t BytesToDrop = (BytesNeeded - BytesLeft);
- uint32_t DropN = std::min(N.size(), BytesToDrop / 2);
- uint32_t DropU = std::min(U.size(), BytesToDrop - DropN);
+ size_t BytesToDrop = (BytesNeeded - BytesLeft);
+ size_t DropN = std::min(N.size(), BytesToDrop / 2);
+ size_t DropU = std::min(U.size(), BytesToDrop - DropN);
N = N.drop_back(DropN);
U = U.drop_back(DropU);
@@ -67,10 +67,10 @@ static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name,
error(IO.mapStringZ(N));
error(IO.mapStringZ(U));
} else {
- uint32_t BytesNeeded = Name.size() + 1;
+ size_t BytesNeeded = Name.size() + 1;
StringRef N = Name;
if (BytesNeeded > BytesLeft) {
- uint32_t BytesToDrop = std::min(N.size(), BytesToDrop);
+ size_t BytesToDrop = std::min(N.size(), BytesToDrop);
N = N.drop_back(BytesToDrop);
}
error(IO.mapStringZ(N));
OpenPOWER on IntegriCloud