From: Benjamin Kramer Date: Tue, 17 Nov 2009 17:57:04 +0000 (+0000) Subject: Revert CPU detection code to return "generic" instead of an empty string in case X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=110e7bb25cab03b6f7051a336233699f3e3ec1e3;p=oota-llvm.git Revert CPU detection code to return "generic" instead of an empty string in case of failure. The x86 target didn't like empty cpu names and broke x86 tests on non-x86 buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89111 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 4275b283354..59340d4d5bc 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -1154,7 +1154,7 @@ public: OS << " with assertions"; #endif std::string CPU = sys::getHostCPUName(); - if (CPU.empty()) CPU = "(unknown)"; + if (CPU == "generic") CPU = "(unknown)"; OS << ".\n" << " Built " << __DATE__ << " (" << __TIME__ << ").\n" << " Host: " << sys::getHostTriple() << '\n' diff --git a/lib/System/Host.cpp b/lib/System/Host.cpp index 0faf8feacf4..37591a57b07 100644 --- a/lib/System/Host.cpp +++ b/lib/System/Host.cpp @@ -249,7 +249,7 @@ std::string sys::getHostCPUName() { } default: - return ""; + return "generic"; } } else if (memcmp(text.c, "AuthenticAMD", 12) == 0) { // FIXME: this poorly matches the generated SubtargetFeatureKV table. There @@ -289,10 +289,10 @@ std::string sys::getHostCPUName() { case 16: return "amdfam10"; default: - return ""; + return "generic"; } } #endif - return ""; + return "generic"; }