[llvm] r188141 - [Sparc] Enable xword directive in sparcv9.

Venkatraman Govindaraju venkatra at cs.wisc.edu
Sat Aug 10 13:13:20 PDT 2013


Author: venkatra
Date: Sat Aug 10 15:13:20 2013
New Revision: 188141

URL: http://llvm.org/viewvc/llvm-project?rev=188141&view=rev
Log:
[Sparc] Enable xword directive in sparcv9.

Modified:
    llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp

Modified: llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp?rev=188141&r1=188140&r2=188141&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp Sat Aug 10 15:13:20 2013
@@ -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;
 





More information about the llvm-commits mailing list