[llvm-commits] [llvm] r93913 - in /llvm/trunk: include/llvm/System/Host.h lib/System/Host.cpp

Xerxes Ranby xerxes at zafena.se
Tue Jan 19 13:26:05 PST 2010


Author: xranby
Date: Tue Jan 19 15:26:05 2010
New Revision: 93913

URL: http://llvm.org/viewvc/llvm-project?rev=93913&view=rev
Log:
Stubs for getHostCPUFeatures API. This implements part of PR5389.


Modified:
    llvm/trunk/include/llvm/System/Host.h
    llvm/trunk/lib/System/Host.cpp

Modified: llvm/trunk/include/llvm/System/Host.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Host.h?rev=93913&r1=93912&r2=93913&view=diff

==============================================================================
--- llvm/trunk/include/llvm/System/Host.h (original)
+++ llvm/trunk/include/llvm/System/Host.h Tue Jan 19 15:26:05 2010
@@ -14,6 +14,7 @@
 #ifndef LLVM_SYSTEM_HOST_H
 #define LLVM_SYSTEM_HOST_H
 
+#include "llvm/ADT/StringMap.h"
 #include <string>
 
 namespace llvm {
@@ -47,6 +48,18 @@
   ///
   /// \return - The host CPU name, or empty if the CPU could not be determined.
   std::string getHostCPUName();
+
+  /// getHostCPUFeatures - Get the LLVM names for the host CPU features.
+  /// The particular format of the names are target dependent, and suitable for
+  /// passing as -mattr to the target which matches the host.
+  ///
+  /// \param Features - A string mapping feature names to either
+  /// true (if enabled) or false (if disabled). This routine makes no guarantees
+  /// about exactly which features may appear in this map, except that they are
+  /// all valid LLVM feature names.
+  ///
+  /// \return - True on success.
+  bool getHostCPUFeatures(StringMap<bool> &Features);
 }
 }
 

Modified: llvm/trunk/lib/System/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Host.cpp?rev=93913&r1=93912&r2=93913&view=diff

==============================================================================
--- llvm/trunk/lib/System/Host.cpp (original)
+++ llvm/trunk/lib/System/Host.cpp Tue Jan 19 15:26:05 2010
@@ -299,3 +299,7 @@
   return "generic";
 }
 #endif
+
+bool sys::getHostCPUFeatures(StringMap<bool> &Features){
+  return false;
+}





More information about the llvm-commits mailing list