/// Returns the allocation type from an MIB metadata node.
AllocationType getMIBAllocType(const MDNode *MIB);
+/// Returns the string to use in attributes with the given type.
+std::string getAllocTypeAttributeString(AllocationType Type);
+
/// True if the AllocTypes bitmask contains just a single type.
bool hasSingleAllocType(uint8_t AllocTypes);
return AllocationType::NotCold;
}
-static std::string getAllocTypeAttributeString(AllocationType Type) {
+std::string llvm::memprof::getAllocTypeAttributeString(AllocationType Type) {
switch (Type) {
case AllocationType::NotCold:
return "notcold";
checkNode<DerivedCCG, FuncTy, CallTy>(Node);
}
-static std::string getAllocTypeAttributeString(AllocationType Type) {
- switch (Type) {
- case AllocationType::NotCold:
- return "notcold";
- break;
- case AllocationType::Cold:
- return "cold";
- break;
- default:
- dbgs() << "Unexpected alloc type " << (uint8_t)Type;
- assert(false);
- }
- llvm_unreachable("invalid alloc type");
-}
-
void ModuleCallsiteContextGraph::updateAllocationCall(
CallInfo &Call, AllocationType AllocType) {
std::string AllocTypeString = getAllocTypeAttributeString(AllocType);