aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86ATTAsmPrinter.cpp6
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp
index bb519560a1..8a6b60425e 100644
--- a/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -806,10 +806,8 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return;
} else {
O << TAI->getCOMMDirective() << name << ',' << Size;
-
- // Leopard and above support aligned common symbols.
- if (Subtarget->getDarwinVers() >= 9)
- O << ',' << Align;
+ if (TAI->getCOMMDirectiveTakesAlignment())
+ O << ',' << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align);
}
} else {
if (!Subtarget->isTargetCygMing()) {
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index f7443c31f7..984c6b225c 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -126,7 +126,8 @@ bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const {
X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
X86TargetAsmInfo(TM), DarwinTargetAsmInfo(TM) {
- bool is64Bit = DTM->getSubtarget<X86Subtarget>().is64Bit();
+ const X86Subtarget* Subtarget = &DTM->getSubtarget<X86Subtarget>();
+ bool is64Bit = Subtarget->is64Bit();
AlignmentIsInBytes = false;
TextAlignFillValue = 0x90;
@@ -156,7 +157,8 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
LCOMMDirective = "\t.lcomm\t";
SwitchToSectionDirective = "\t.section ";
StringConstantPrefix = "\1LC";
- COMMDirectiveTakesAlignment = false;
+ // Leopard and above support aligned common symbols.
+ COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
HasDotTypeDotSizeDirective = false;
if (TM.getRelocationModel() == Reloc::Static) {
StaticCtorsSection = ".constructor";