aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMSubtarget.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-06-30 02:12:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-06-30 02:12:44 +0000
commit4cc446bc400b2ff58af81c91f5e145b81d6beb26 (patch)
treea2ac9cc1f1cf513120c3405d3499cf2d5b268c45 /lib/Target/ARM/ARMSubtarget.cpp
parent276365dd4bc0c2160f91fd8062ae1fc90c86c324 (diff)
Fix ARMSubtarget feature parsing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMSubtarget.cpp')
-rw-r--r--lib/Target/ARM/ARMSubtarget.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index cf67497d94..694b31385b 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -120,17 +120,14 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &CPU,
if (TT.find("eabi") != std::string::npos)
TargetABI = ARM_ABI_AAPCS;
- // Parse features string. If the first entry in FS (the CPU) is missing,
- // insert the architecture feature derived from the target triple. This is
- // important for setting features that are implied based on the architecture
- // version.
- std::string FSWithArch;
- if (FS.empty())
- FSWithArch = std::string(ARMArchFeature);
- else if (FS.find(',') == 0)
- FSWithArch = std::string(ARMArchFeature) + FS;
- else
+ // Insert the architecture feature derived from the target triple into the
+ // feature string. This is important for setting features that are implied
+ // based on the architecture version.
+ std::string FSWithArch = std::string(ARMArchFeature);
+ if (FSWithArch.empty())
FSWithArch = FS;
+ else if (!FS.empty())
+ FSWithArch = FSWithArch + "," + FS;
ParseSubtargetFeatures(FSWithArch, CPUString);
// After parsing Itineraries, set ItinData.IssueWidth.