diff options
-rw-r--r-- | include/llvm/ProfileData/SampleProf.h | 4 | ||||
-rw-r--r-- | include/llvm/ProfileData/SampleProfReader.h | 2 | ||||
-rw-r--r-- | lib/ProfileData/SampleProfWriter.cpp | 4 | ||||
-rw-r--r-- | tools/llvm-profdata/llvm-profdata.cpp | 21 | ||||
-rw-r--r-- | unittests/ProfileData/SampleProfTest.cpp | 2 |
5 files changed, 16 insertions, 17 deletions
diff --git a/include/llvm/ProfileData/SampleProf.h b/include/llvm/ProfileData/SampleProf.h index 5221540c63d..0cd6dd2c2c0 100644 --- a/include/llvm/ProfileData/SampleProf.h +++ b/include/llvm/ProfileData/SampleProf.h @@ -83,10 +83,10 @@ enum SampleProfileFormat { SPF_Text = 0x1, SPF_Compact_Binary = 0x2, SPF_GCC = 0x3, - SPF_Raw_Binary = 0xff + SPF_Binary = 0xff }; -static inline uint64_t SPMagic(SampleProfileFormat Format = SPF_Raw_Binary) { +static inline uint64_t SPMagic(SampleProfileFormat Format = SPF_Binary) { return uint64_t('S') << (64 - 8) | uint64_t('P') << (64 - 16) | uint64_t('R') << (64 - 24) | uint64_t('O') << (64 - 32) | uint64_t('F') << (64 - 40) | uint64_t('4') << (64 - 48) | diff --git a/include/llvm/ProfileData/SampleProfReader.h b/include/llvm/ProfileData/SampleProfReader.h index f15336fefea..0617b05e8d4 100644 --- a/include/llvm/ProfileData/SampleProfReader.h +++ b/include/llvm/ProfileData/SampleProfReader.h @@ -426,7 +426,7 @@ private: public: SampleProfileReaderRawBinary(std::unique_ptr<MemoryBuffer> B, LLVMContext &C) - : SampleProfileReaderBinary(std::move(B), C, SPF_Raw_Binary) {} + : SampleProfileReaderBinary(std::move(B), C, SPF_Binary) {} /// \brief Return true if \p Buffer is in the format supported by this class. static bool hasFormat(const MemoryBuffer &Buffer); diff --git a/lib/ProfileData/SampleProfWriter.cpp b/lib/ProfileData/SampleProfWriter.cpp index 092139d4aa9..b4de30118b8 100644 --- a/lib/ProfileData/SampleProfWriter.cpp +++ b/lib/ProfileData/SampleProfWriter.cpp @@ -294,7 +294,7 @@ ErrorOr<std::unique_ptr<SampleProfileWriter>> SampleProfileWriter::create(StringRef Filename, SampleProfileFormat Format) { std::error_code EC; std::unique_ptr<raw_ostream> OS; - if (Format == SPF_Raw_Binary || Format == SPF_Compact_Binary) + if (Format == SPF_Binary || Format == SPF_Compact_Binary) OS.reset(new raw_fd_ostream(Filename, EC, sys::fs::F_None)); else OS.reset(new raw_fd_ostream(Filename, EC, sys::fs::F_Text)); @@ -317,7 +317,7 @@ SampleProfileWriter::create(std::unique_ptr<raw_ostream> &OS, std::error_code EC; std::unique_ptr<SampleProfileWriter> Writer; - if (Format == SPF_Raw_Binary) + if (Format == SPF_Binary) Writer.reset(new SampleProfileWriterRawBinary(OS)); else if (Format == SPF_Compact_Binary) Writer.reset(new SampleProfileWriterCompactBinary(OS)); diff --git a/tools/llvm-profdata/llvm-profdata.cpp b/tools/llvm-profdata/llvm-profdata.cpp index cab1237f7aa..1a0b9e127bb 100644 --- a/tools/llvm-profdata/llvm-profdata.cpp +++ b/tools/llvm-profdata/llvm-profdata.cpp @@ -39,7 +39,7 @@ enum ProfileFormat { PF_Text, PF_Compact_Binary, PF_GCC, - PF_Raw_Binary + PF_Binary }; static void warn(Twine Message, std::string Whence = "", @@ -242,7 +242,7 @@ static void mergeInstrProfile(const WeightedFileVector &Inputs, if (OutputFilename.compare("-") == 0) exitWithError("Cannot write indexed profdata format to stdout."); - if (OutputFormat != PF_Raw_Binary && OutputFormat != PF_Compact_Binary && + if (OutputFormat != PF_Binary && OutputFormat != PF_Compact_Binary && OutputFormat != PF_Text) exitWithError("Unknown format is specified."); @@ -324,7 +324,7 @@ static void mergeInstrProfile(const WeightedFileVector &Inputs, static sampleprof::SampleProfileFormat FormatMap[] = { sampleprof::SPF_None, sampleprof::SPF_Text, sampleprof::SPF_Compact_Binary, - sampleprof::SPF_GCC, sampleprof::SPF_Raw_Binary}; + sampleprof::SPF_GCC, sampleprof::SPF_Binary}; static void mergeSampleProfile(const WeightedFileVector &Inputs, StringRef OutputFilename, @@ -471,14 +471,13 @@ static int merge_main(int argc, const char *argv[]) { cl::values(clEnumVal(instr, "Instrumentation profile (default)"), clEnumVal(sample, "Sample profile"))); cl::opt<ProfileFormat> OutputFormat( - cl::desc("Format of output profile"), cl::init(PF_Raw_Binary), - cl::values( - clEnumValN(PF_Raw_Binary, "binary", "Binary encoding (default)"), - clEnumValN(PF_Compact_Binary, "compbinary", - "Compact binary encoding"), - clEnumValN(PF_Text, "text", "Text encoding"), - clEnumValN(PF_GCC, "gcc", - "GCC encoding (only meaningful for -sample)"))); + cl::desc("Format of output profile"), cl::init(PF_Binary), + cl::values(clEnumValN(PF_Binary, "binary", "Binary encoding (default)"), + clEnumValN(PF_Compact_Binary, "compbinary", + "Compact binary encoding"), + clEnumValN(PF_Text, "text", "Text encoding"), + clEnumValN(PF_GCC, "gcc", + "GCC encoding (only meaningful for -sample)"))); cl::opt<bool> OutputSparse("sparse", cl::init(false), cl::desc("Generate a sparse profile (only meaningful for -instr)")); cl::opt<unsigned> NumThreads( diff --git a/unittests/ProfileData/SampleProfTest.cpp b/unittests/ProfileData/SampleProfTest.cpp index bc19eb5f07c..3ebfd0e500f 100644 --- a/unittests/ProfileData/SampleProfTest.cpp +++ b/unittests/ProfileData/SampleProfTest.cpp @@ -180,7 +180,7 @@ TEST_F(SampleProfTest, roundtrip_text_profile) { } TEST_F(SampleProfTest, roundtrip_raw_binary_profile) { - testRoundTrip(SampleProfileFormat::SPF_Raw_Binary); + testRoundTrip(SampleProfileFormat::SPF_Binary); } TEST_F(SampleProfTest, roundtrip_compact_binary_profile) { |