summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-01-26 20:21:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-01-26 20:21:43 +0000
commitdcb03f0f6b15aeadb9b627a1a3cd9e1ead6cd393 (patch)
tree38315ed26aa59e5897c7d6efbb588d7e143c57b5 /llvm/lib/MC
parent3dd38a81128a39811c40b52a3f7c3590897babe8 (diff)
downloadbcm5719-llvm-dcb03f0f6b15aeadb9b627a1a3cd9e1ead6cd393.tar.gz
bcm5719-llvm-dcb03f0f6b15aeadb9b627a1a3cd9e1ead6cd393.zip
Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
Original patch by Sandeep Patel and updated by me. llvm-svn: 94582
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAsmInfo.cpp1
-rw-r--r--llvm/lib/MC/MCAsmInfoCOFF.cpp2
-rw-r--r--llvm/lib/MC/MCAsmInfoDarwin.cpp1
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp2
4 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp
index 4a86e1df89a..12d2fcbadc6 100644
--- a/llvm/lib/MC/MCAsmInfo.cpp
+++ b/llvm/lib/MC/MCAsmInfo.cpp
@@ -51,6 +51,7 @@ MCAsmInfo::MCAsmInfo() {
GlobalDirective = "\t.globl\t";
SetDirective = 0;
HasLCOMMDirective = false;
+ COMMDirectiveAlignmentIsInBytes = true;
HasDotTypeDotSizeDirective = true;
HasSingleParameterDotFile = true;
HasNoDeadStrip = false;
diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp
index e6b79dd9d12..ab8a585480f 100644
--- a/llvm/lib/MC/MCAsmInfoCOFF.cpp
+++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp
@@ -18,6 +18,7 @@ using namespace llvm;
MCAsmInfoCOFF::MCAsmInfoCOFF() {
GlobalPrefix = "_";
+ COMMDirectiveAlignmentIsInBytes = false;
HasLCOMMDirective = true;
HasDotTypeDotSizeDirective = false;
HasSingleParameterDotFile = false;
@@ -36,4 +37,3 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
SupportsDebugInformation = true;
DwarfSectionOffsetDirective = "\t.secrel32\t";
}
-
diff --git a/llvm/lib/MC/MCAsmInfoDarwin.cpp b/llvm/lib/MC/MCAsmInfoDarwin.cpp
index 2cf982f3938..e84131f5990 100644
--- a/llvm/lib/MC/MCAsmInfoDarwin.cpp
+++ b/llvm/lib/MC/MCAsmInfoDarwin.cpp
@@ -26,6 +26,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
HasSubsectionsViaSymbols = true;
AlignmentIsInBytes = false;
+ COMMDirectiveAlignmentIsInBytes = false;
InlineAsmStart = " InlineAsm Start";
InlineAsmEnd = " InlineAsm End";
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index d177f9525a1..b544d04f14f 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -282,7 +282,7 @@ void MCAsmStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) {
OS << "\t.comm\t" << *Symbol << ',' << Size;
if (ByteAlignment != 0) {
- if (MAI.getAlignmentIsInBytes())
+ if (MAI.getCOMMDirectiveAlignmentIsInBytes())
OS << ',' << ByteAlignment;
else
OS << ',' << Log2_32(ByteAlignment);
OpenPOWER on IntegriCloud