-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC]Rename InstrProf::getFuncName{,orExternalSymbol} to getValueName{,orExternalSymbol} #68240
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -510,14 +510,14 @@ class InstrProfSymtab { | |
/// an empty string. | ||
StringRef getFuncName(uint64_t FuncNameAddress, size_t NameSize); | ||
|
||
/// Return function's PGO name from the name's md5 hash value. | ||
/// If not found, return an empty string. | ||
inline StringRef getFuncName(uint64_t FuncMD5Hash); | ||
/// Return name of functions or global variables from the name's md5 hash | ||
/// value. If not found, return an empty string. | ||
inline StringRef getValueName(uint64_t ValMD5Hash); | ||
|
||
/// Just like getFuncName, except that it will return a non-empty StringRef | ||
/// if the function is external to this symbol table. All such cases | ||
/// will be represented using the same StringRef value. | ||
inline StringRef getFuncNameOrExternalSymbol(uint64_t FuncMD5Hash); | ||
/// Just like getValueName, except that it will return a non-empty StringRef | ||
/// if the value (function or global variable) is external to this symbol | ||
/// table. All such cases will be represented using the same StringRef value. | ||
inline StringRef getValueNameOrExternalSymbol(uint64_t ValMD5Hash); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getFuncOrVarNameIfDefined(). Update comment to say 'External Symbol' is returned if not found. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
|
||
/// True if Symbol is the value used to represent external symbols. | ||
static bool isExternalSymbol(const StringRef &Symbol) { | ||
|
@@ -565,14 +565,14 @@ void InstrProfSymtab::finalizeSymtab() { | |
Sorted = true; | ||
} | ||
|
||
StringRef InstrProfSymtab::getFuncNameOrExternalSymbol(uint64_t FuncMD5Hash) { | ||
StringRef ret = getFuncName(FuncMD5Hash); | ||
StringRef InstrProfSymtab::getValueNameOrExternalSymbol(uint64_t FuncMD5Hash) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FuncMD5Hash -- MD5Hash There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
StringRef ret = getValueName(FuncMD5Hash); | ||
if (ret.empty()) | ||
return InstrProfSymtab::getExternalSymbol(); | ||
return ret; | ||
} | ||
|
||
StringRef InstrProfSymtab::getFuncName(uint64_t FuncMD5Hash) { | ||
StringRef InstrProfSymtab::getValueName(uint64_t FuncMD5Hash) { | ||
finalizeSymtab(); | ||
auto Result = llvm::lower_bound(MD5NameMap, FuncMD5Hash, | ||
[](const std::pair<uint64_t, StringRef> &LHS, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make the name clearer: getFuncOrVarName().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.