[SPARC] Don't compare arch name as a string, use the enum instead.

Fixes PR22695

llvm-svn: 244221
This commit is contained in:
Douglas Katzman 2015-08-06 15:44:12 +00:00
parent df1e05a26c
commit 63d64da0ce
2 changed files with 5 additions and 2 deletions

View File

@ -77,7 +77,7 @@ class SparcAsmParser : public MCTargetAsmParser {
bool parseDirectiveWord(unsigned Size, SMLoc L);
bool is64Bit() const {
return STI.getTargetTriple().getArchName().startswith("sparcv9");
return STI.getTargetTriple().getArch() == Triple::sparcv9;
}
void expandSET(MCInst &Inst, SMLoc IDLoc,

View File

@ -1,5 +1,6 @@
! RUN: not llvm-mc %s -arch=sparc -show-encoding 2>&1 | FileCheck %s --check-prefix=SPARC32
! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARC64
! RUN: llvm-mc %s -triple sparc64 -show-encoding | FileCheck %s --check-prefix=SPARC64
! RUN: llvm-mc %s -triple sparcv9 -show-encoding | FileCheck %s --check-prefix=SPARCV9
! SPARC32: error: unknown directive
! SPARC32-NEXT: .xword 65536
@ -8,3 +9,5 @@
! SPARC64: .xword 65536
.xword 65536
! SPARCV9: .xword 65536
.xword 65536