Skip to content

Commit ce00b9d

Browse files
committed
Add a comment.
1 parent a4af7bd commit ce00b9d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,9 @@ bool SampleProfileMatcher::functionMatchesProfileHelper(
738738
if (Demangler.partialDemangle(FunctionName.c_str()))
739739
return std::string();
740740
size_t BaseNameSize = 0;
741+
// The demangler API follows the __cxa_demangle one, and thus needs a
742+
// pointer that originates from malloc (or nullptr) and the caller is
743+
// responsible for free()-ing the buffer.
741744
char *BaseNamePtr = Demangler.getFunctionBaseName(nullptr, &BaseNameSize);
742745
std::string Result = (BaseNamePtr && BaseNameSize)
743746
? std::string(BaseNamePtr, BaseNameSize)

0 commit comments

Comments
 (0)