Fixes a crash in llc where some parts think the target is thumb and others think
it is ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197607
91177308-0d34-0410-b5e6-
96231b3b80d8
unsigned Idx = 0;
// FIXME: Enhance Triple helper class to extract ARM version.
- bool isThumb = false;
+ bool isThumb = triple.getArch() == Triple::thumb;
if (Len >= 5 && TT.substr(0, 4) == "armv")
Idx = 4;
- else if (Len >= 6 && TT.substr(0, 5) == "thumb") {
- isThumb = true;
- if (Len >= 7 && TT[5] == 'v')
- Idx = 6;
- }
+ else if (Len >= 7 && TT.substr(0, 6) == "thumbv")
+ Idx = 6;
bool NoCPU = CPU == "generic" || CPU.empty();
std::string ARMArchFeature;
--- /dev/null
+; RUN: llc < %s -mtriple=thumb | FileCheck %s
+
+; CHECK: .code 16
+
+define void @f() {
+ ret void
+}