summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/SampleProfWriter.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2015-10-15 16:36:21 +0000
committerDiego Novillo <dnovillo@google.com>2015-10-15 16:36:21 +0000
commit38be33302c443f7bca45cad26855fea535516436 (patch)
tree24ec2e74826a3fe8505cf7b58460646b08540d29 /llvm/lib/ProfileData/SampleProfWriter.cpp
parent4f3589c779e342557fd28c8133b68f4d075b5d39 (diff)
downloadbcm5719-llvm-38be33302c443f7bca45cad26855fea535516436.tar.gz
bcm5719-llvm-38be33302c443f7bca45cad26855fea535516436.zip
Sample Profiles - Adjust integer types. Mostly NFC.
This adjusts all integers in the reader/writer to reflect the types stored on profile files. They should all be unsigned 32-bit or 64-bit values. Changed all associated internal types to be uint32_t or uint64_t. The only place that needed some adjustments is in the sample profile transformation. Altough the weight read from the profile are 64-bit values, the internal API for branch weights only accepts 32-bit values. The pass now saturates weights that overflow uint32_t. llvm-svn: 250427
Diffstat (limited to 'llvm/lib/ProfileData/SampleProfWriter.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProfWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp
index d3001aac3f6..daf3783aba6 100644
--- a/llvm/lib/ProfileData/SampleProfWriter.cpp
+++ b/llvm/lib/ProfileData/SampleProfWriter.cpp
@@ -144,7 +144,7 @@ std::error_code SampleProfileWriterBinary::write(StringRef FName,
encodeULEB128(Sample.getCallTargets().size(), OS);
for (const auto &J : Sample.getCallTargets()) {
StringRef Callee = J.first();
- unsigned CalleeSamples = J.second;
+ uint64_t CalleeSamples = J.second;
if (std::error_code EC = writeNameIdx(Callee))
return EC;
encodeULEB128(CalleeSamples, OS);
OpenPOWER on IntegriCloud