We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4af7bd commit ce00b9dCopy full SHA for ce00b9d
llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
@@ -738,6 +738,9 @@ bool SampleProfileMatcher::functionMatchesProfileHelper(
738
if (Demangler.partialDemangle(FunctionName.c_str()))
739
return std::string();
740
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.
744
char *BaseNamePtr = Demangler.getFunctionBaseName(nullptr, &BaseNameSize);
745
std::string Result = (BaseNamePtr && BaseNameSize)
746
? std::string(BaseNamePtr, BaseNameSize)
0 commit comments