================ @@ -15,22 +15,23 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/TargetParser/Host.h" +#include <optional> + using namespace llvm; int main(int argc, char **argv) { #if defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64__) || defined(_M_X64) - StringMap<bool> features; - - if (!sys::getHostCPUFeatures(features)) + if (std::optional<StringMap<bool>> features = + sys::getHostCPUFeatures(features)) { + if ((*features)["sse"]) ---------------- tmatheson-arm wrote:
Maybe ```suggestion if (features->lookup("sse")) ``` which does the same, but doesn't insert the default entry into the map. https://github.com/llvm/llvm-project/pull/97824 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits