[clang] [llvm] [clang][AArch64] Add getHostCPUFeatures to query for enabled features in cpu info (PR #97749)

David Green via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 12:54:50 PDT 2024


================
@@ -70,6 +70,10 @@ static std::unique_ptr<llvm::MemoryBuffer>
     LLVM_ATTRIBUTE_UNUSED getProcCpuinfoContent() {
   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Text =
       llvm::MemoryBuffer::getFileAsStream("/proc/cpuinfo");
+  if (const char *cpuinfoIntercept = std::getenv("LLVM_CPUINFO")) {
+    Text = llvm::MemoryBuffer::getFileAsStream(cpuinfoIntercept);
+  }
+
   if (std::error_code EC = Text.getError()) {
     llvm::errs() << "Can't read "
                  << "/proc/cpuinfo: " << EC.message() << "\n";
----------------
davemgreen wrote:

This error message could then use the filename as above.

https://github.com/llvm/llvm-project/pull/97749


More information about the cfe-commits mailing list