Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -6545,6 +6545,8 @@ initFeatureMap(llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeaturesVec) const override { + if (CPU.empty()) + CPU = getCPU(); if (CPU == "octeon") Features["mips64r2"] = Features["cnmips"] = true; else