summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2016-08-11 17:20:18 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2016-08-11 17:20:18 +0000
commitcdc7161281c28a4dc03c9de22e647aaf8a0f3226 (patch)
treea3389fcb82b5b81195786c7580d8189f2cc2c0c0 /llvm/lib/ProfileData
parentfe24bff8c6a4d8e5d23309bf6fe151860dc97ecd (diff)
downloadbcm5719-llvm-cdc7161281c28a4dc03c9de22e647aaf8a0f3226.tar.gz
bcm5719-llvm-cdc7161281c28a4dc03c9de22e647aaf8a0f3226.zip
Fix some Clang-tidy modernize and Include What You Use warnings.
Differential revision: https://reviews.llvm.org/D23291 llvm-svn: 278364
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/InstrProfWriter.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index 7fabcdbff63..cb839f92636 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -13,10 +13,18 @@
//===----------------------------------------------------------------------===//
#include "llvm/ProfileData/InstrProfWriter.h"
-#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/IR/ProfileSummary.h"
+#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/Support/EndianStream.h"
+#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/OnDiskHashTable.h"
+#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <string>
#include <tuple>
+#include <utility>
+#include <vector>
using namespace llvm;
@@ -29,6 +37,7 @@ struct PatchItem {
};
namespace llvm {
+
// A wrapper class to abstract writer stream with support of bytes
// back patching.
class ProfOStream {
@@ -40,6 +49,7 @@ public:
uint64_t tell() { return OS.tell(); }
void write(uint64_t V) { LE.write<uint64_t>(V); }
+
// \c patch can only be called when all data is written and flushed.
// For raw_string_ostream, the patch is done on the target string
// directly and it won't be reflected in the stream's internal buffer.
@@ -65,6 +75,7 @@ public:
}
}
}
+
// If \c OS is an instance of \c raw_fd_ostream, this field will be
// true. Otherwise, \c OS will be an raw_string_ostream.
bool IsFDOStream;
@@ -139,7 +150,8 @@ public:
}
}
};
-}
+
+} // end namespace llvm
InstrProfWriter::InstrProfWriter(bool Sparse)
: Sparse(Sparse), FunctionData(), ProfileKind(PF_Unknown),
@@ -152,6 +164,7 @@ void InstrProfWriter::setValueProfDataEndianness(
support::endianness Endianness) {
InfoObj->ValueProfDataEndianness = Endianness;
}
+
void InstrProfWriter::setOutputSparse(bool Sparse) {
this->Sparse = Sparse;
}
@@ -269,7 +282,7 @@ void InstrProfWriter::writeImpl(ProfOStream &OS) {
// structure to be serialized out (to disk or buffer).
std::unique_ptr<ProfileSummary> PS = ISB.getSummary();
setSummary(TheSummary.get(), *PS);
- InfoObj->SummaryBuilder = 0;
+ InfoObj->SummaryBuilder = nullptr;
// Now do the final patch:
PatchItem PatchItems[] = {
OpenPOWER on IntegriCloud