[Sparc] Enable xword directive in sparcv9.
authorVenkatraman Govindaraju <venkatra@cs.wisc.edu>
Sat, 10 Aug 2013 20:13:20 +0000 (20:13 +0000)
committerVenkatraman Govindaraju <venkatra@cs.wisc.edu>
Sat, 10 Aug 2013 20:13:20 +0000 (20:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188141 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp

index 5a52abee03a494a86695df58d82be973d85539d0..45cfe033bb950e574ae5391f8dbe9f194c2bc2c3 100644 (file)
@@ -21,18 +21,21 @@ void SparcELFMCAsmInfo::anchor() { }
 SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) {
   IsLittleEndian = false;
   Triple TheTriple(TT);
-  if (TheTriple.getArch() == Triple::sparcv9) {
+  bool isV9 = (TheTriple.getArch() == Triple::sparcv9);
+
+  if (isV9) {
     PointerSize = CalleeSaveStackSlotSize = 8;
   }
 
   Data16bitsDirective = "\t.half\t";
   Data32bitsDirective = "\t.word\t";
-  Data64bitsDirective = 0;  // .xword is only supported by V9.
+  // .xword is only supported by V9.
+  Data64bitsDirective = (isV9) ? "\t.xword\t" : 0;
   ZeroDirective = "\t.skip\t";
   CommentString = "!";
   HasLEB128 = true;
   SupportsDebugInformation = true;
-  
+
   SunStyleELFSectionSwitchSyntax = true;
   UsesELFSectionDirectiveForBSS = true;