From 74f444cde58a2ef683a15fae4321342f417f1e13 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 12 Dec 2013 15:45:32 +0000 Subject: [PATCH] Return a StringRef from getHostCPUName. llvm-svn: 197158 --- llvm/include/llvm/Support/Host.h | 2 +- llvm/lib/Support/Host.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h index 28c4cc790fe5..8f4bf3c1ba56 100644 --- a/llvm/include/llvm/Support/Host.h +++ b/llvm/include/llvm/Support/Host.h @@ -55,7 +55,7 @@ namespace sys { /// target which matches the host. /// /// \return - The host CPU name, or empty if the CPU could not be determined. - std::string getHostCPUName(); + StringRef getHostCPUName(); /// getHostCPUFeatures - Get the LLVM names for the host CPU features. /// The particular format of the names are target dependent, and suitable for diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index b423ada6fa1c..d883c0588728 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -193,7 +193,7 @@ static void DetectX86FamilyModel(unsigned EAX, unsigned &Family, } } -std::string sys::getHostCPUName() { +StringRef sys::getHostCPUName() { unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0; if (GetX86CpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX)) return "generic";