Skip to content

Commit 3abef1b

Browse files
Address comments.
1 parent d403516 commit 3abef1b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

llvm/include/llvm/ProfileData/MemProf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,6 @@ template <> struct MappingTraits<memprof::Frame> {
11791179
}
11801180

11811181
// Request the inline notation for brevity:
1182-
//
11831182
// { Function: 123, LineOffset: 11, Column: 10; IsInlineFrame: true }
11841183
static const bool flow = true;
11851184
};

llvm/unittests/ProfileData/MemProfTest.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -808,15 +808,20 @@ TEST(MemProf, YAMLParser) {
808808
ElementsAre(hashCallStack(CS3), hashCallStack(CS4)));
809809
}
810810

811-
TEST(MemProf, YAMLWriterFrame) {
812-
Frame F(12, 34, 56, true);
813-
811+
template <typename T> std::string serializeInYAML(T &Val) {
814812
std::string Out;
815813
llvm::raw_string_ostream OS(Out);
816814
llvm::yaml::Output Yout(OS);
817-
Yout << F;
815+
Yout << Val;
816+
return Out;
817+
}
818+
819+
TEST(MemProf, YAMLWriterFrame) {
820+
Frame F(11, 22, 33, true);
821+
822+
std::string Out = serializeInYAML(F);
818823
EXPECT_EQ(Out, R"YAML(---
819-
{ Function: 12, LineOffset: 34, Column: 56, Inline: true }
824+
{ Function: 11, LineOffset: 22, Column: 33, Inline: true }
820825
...
821826
)YAML");
822827
}
@@ -829,10 +834,7 @@ TEST(MemProf, YAMLWriterMIB) {
829834
MIB.TotalLifetimeAccessDensity = 444;
830835
PortableMemInfoBlock PMIB(MIB, llvm::memprof::getHotColdSchema());
831836

832-
std::string Out;
833-
llvm::raw_string_ostream OS(Out);
834-
llvm::yaml::Output Yout(OS);
835-
Yout << PMIB;
837+
std::string Out = serializeInYAML(PMIB);
836838
EXPECT_EQ(Out, R"YAML(---
837839
AllocCount: 111
838840
TotalSize: 222

0 commit comments

Comments
 (0)