diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-06-30 02:12:44 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-06-30 02:12:44 +0000 |
commit | 0b33a323acad43e71fa23bdb99c8753bf6fcb963 (patch) | |
tree | b237f22efb65c38c8cab4366dcf8b67b1f578b50 /llvm/lib/Target | |
parent | adc7959851b4f90c8c921a86ee7e806d776cea8d (diff) | |
download | bcm5719-llvm-0b33a323acad43e71fa23bdb99c8753bf6fcb963.tar.gz bcm5719-llvm-0b33a323acad43e71fa23bdb99c8753bf6fcb963.zip |
Fix ARMSubtarget feature parsing.
llvm-svn: 134129
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/ARM/ARMSubtarget.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp index cf67497d944..694b31385b2 100644 --- a/llvm/lib/Target/ARM/ARMSubtarget.cpp +++ b/llvm/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. |