================ @@ -1710,15 +1710,17 @@ VendorSignatures getVendorSignature(unsigned *MaxLeaf) { #if defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64__) || defined(_M_X64) -bool sys::getHostCPUFeatures(StringMap<bool> &Features) { +std::optional<StringMap<bool>> sys::getHostCPUFeatures() { unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0; unsigned MaxLevel; if (getX86CpuIDAndInfo(0, &MaxLevel, &EBX, &ECX, &EDX) || MaxLevel < 1) - return false; + return {}; getX86CpuIDAndInfo(1, &EAX, &EBX, &ECX, &EDX); + StringMap<bool> Features; ---------------- phoebewang wrote:
IIUC, the motivation is to avoid creating a blank map. But here we still create it with each call. Is there any difference except early return in line 1728, which should rarely happend. https://github.com/llvm/llvm-project/pull/97824 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits