Add `IsMMapped` flag to `buildGUID2FuncDescMap` controlling whether to allocate a string in `FuncNameAllocator` or use StringRef directly. Keep it false by default, only set it for BOLT use case because BOLT keeps file sections in memory while processing them. llvm-profgen constructs GUID2FuncDescMap and then releases the binary. For medium sized binary with 0.8 GiB .pseudo_probe_desc section, this saves 0.7 GiB peak RSS in perf2bolt. Test Plan: no-op for llvm-profgen, NFC for perf2bolt Reviewers: maksfb, dcci, wlei-llvm, rafaelauler, ayermolo Reviewed By: wlei-llvm Pull Request: https://github.com/llvm/llvm-project/pull/112996
26 KiB
26 KiB