Propagate CPU string out of SubtargetFeatures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72335 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index 2415a85..7379f1c 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -23,14 +23,13 @@
, UseThumbBacktraces(false)
, IsR9Reserved(false)
, stackAlignment(4)
+ , CPUString("generic")
, TargetType(isELF) // Default to ELF unless otherwise specified.
, TargetABI(ARM_ABI_APCS) {
-
// Determine default and user specified characteristics
- std::string CPU = "generic";
// Parse features string.
- ParseSubtargetFeatures(FS, CPU);
+ CPUString = ParseSubtargetFeatures(FS, CPUString);
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index fbc9e57..870a8c7 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -47,6 +47,9 @@
/// entry to the function and which must be maintained by every function.
unsigned stackAlignment;
+ /// CPUString - String name of used CPU.
+ std::string CPUString;
+
public:
enum {
isELF, isDarwin
@@ -71,7 +74,8 @@
}
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
- void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
+ std::string ParseSubtargetFeatures(const std::string &FS,
+ const std::string &CPU);
bool hasV4TOps() const { return ARMArchVersion >= V4T; }
bool hasV5TOps() const { return ARMArchVersion >= V5T; }
@@ -79,7 +83,7 @@
bool hasV6Ops() const { return ARMArchVersion >= V6; }
bool hasVFP2() const { return HasVFP2; }
-
+
bool isTargetDarwin() const { return TargetType == isDarwin; }
bool isTargetELF() const { return TargetType == isELF; }
@@ -91,6 +95,8 @@
bool useThumbBacktraces() const { return UseThumbBacktraces; }
bool isR9Reserved() const { return IsR9Reserved; }
+ const std::string & getCPUString() const { return CPUString; }
+
/// getStackAlignment - Returns the minimum alignment known to hold of the
/// stack frame on entry to the function and which must be maintained by every
/// function for this subtarget.