labath added a comment. It's not clear to me why you're insisting on `call_once`, when c++ guarantees that the function-local statics will only be initialized once (atomically). And with the new version, we don't even need the lambda..
================ Comment at: lldb/source/Plugins/Process/Linux/Procfs.cpp:12 #include "lldb/Host/linux/Support.h" + #include "llvm/Support/MemoryBuffer.h" ---------------- btw, llvm does not generally put blank lines between include headers. omitting those lets clang format reorder everything according to the [[ https://llvm.org/docs/CodingStandards.html#include-style | official style ]]. ================ Comment at: lldb/source/Plugins/Process/Linux/Procfs.cpp:22-26 + static Optional<ErrorOr<std::unique_ptr<MemoryBuffer>>> cpu_info_or_err; + static llvm::once_flag g_once_flag; + + llvm::call_once(g_once_flag, + [] { cpu_info_or_err = getProcFile("cpuinfo"); }); ---------------- And why not this? ================ Comment at: lldb/source/Plugins/Process/Linux/Procfs.cpp:30 + + MemoryBuffer &buffer = ***cpu_info_or_err; + return ArrayRef<uint8_t>( ---------------- lol Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131081/new/ https://reviews.llvm.org/D131081 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits