LLVM: llvm::sampleprof::FunctionId Class Reference (original) (raw)
This class represents a function that is read from a sample profile. More...
#include "[llvm/ProfileData/FunctionId.h](ProfileData%5F2FunctionId%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| FunctionId ()=default | |
| FunctionId (StringRef Str) | |
| Constructor from a StringRef. | |
| FunctionId (uint64_t HashCode) | |
| Constructor from a hash code. | |
| bool | equals (const FunctionId &Other) const |
| Check for equality. | |
| int | compare (const FunctionId &Other) const |
| Total order comparison. | |
| std::string | str () const |
| Convert to a string, usually for output purpose. | |
| StringRef | stringRef () const |
| Convert to StringRef. | |
| uint64_t | getHashCode () const |
| Get hash code of this object. | |
| bool | empty () const |
| bool | isStringRef () const |
| Check if this object represents a StringRef, or a hash code. |
This class represents a function that is read from a sample profile.
It comes with two forms: a string or a hash code. The latter form is the 64-bit MD5 of the function name for efficient storage supported by ExtBinary profile format, and when reading the profile, this class can represent it without converting it to a string first. When representing a hash code, we utilize the LengthOrHashCode field to store it, and Name is set to null. When representing a string, it is same as StringRef.
Definition at line 36 of file FunctionId.h.
| llvm::sampleprof::FunctionId::FunctionId ( ) | default |
|---|
◆ FunctionId() [2/3]
| llvm::sampleprof::FunctionId::FunctionId ( StringRef Str) | inlineexplicit |
|---|
◆ FunctionId() [3/3]
| llvm::sampleprof::FunctionId::FunctionId ( uint64_t HashCode) | inlineexplicit |
|---|
◆ compare()
| int llvm::sampleprof::FunctionId::compare ( const FunctionId & Other) const | inline |
|---|
◆ empty()
| bool llvm::sampleprof::FunctionId::empty ( ) const | inline |
|---|
◆ equals()
Check for equality.
Similar to StringRef::equals, but will also cover for the case where one or both are hash codes. Comparing their int values are sufficient. A hash code FunctionId is considered not equal to a StringRef FunctionId regardless of actual contents.
Definition at line 76 of file FunctionId.h.
References FunctionId(), and llvm::Other.
◆ getHashCode()
| uint64_t llvm::sampleprof::FunctionId::getHashCode ( ) const | inline |
|---|
◆ isStringRef()
| bool llvm::sampleprof::FunctionId::isStringRef ( ) const | inline |
|---|
◆ str()
| std::string llvm::sampleprof::FunctionId::str ( ) const | inline |
|---|
◆ stringRef()
| StringRef llvm::sampleprof::FunctionId::stringRef ( ) const | inline |
|---|
◆ operator<<
The documentation for this class was generated from the following file:
- include/llvm/ProfileData/FunctionId.h