summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-26 18:30:45 +0000
committerChris Lattner <sabre@nondot.org>2010-04-26 18:30:45 +0000
commitf74e25f60c8c63b819ff603cb4c3c18424dc87a7 (patch)
tree27618d33d803dd7a7239da94ac0861517e3a1d58
parent8581c260d3595fd78ce9f1585c85bea545fce5f3 (diff)
downloadllvm-f74e25f60c8c63b819ff603cb4c3c18424dc87a7.tar.gz
llvm-f74e25f60c8c63b819ff603cb4c3c18424dc87a7.tar.bz2
llvm-f74e25f60c8c63b819ff603cb4c3c18424dc87a7.tar.xz
Revert r102300/102301, which serious broke objc apps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102359 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp6
-rw-r--r--test/CodeGen/X86/alignment.ll16
-rw-r--r--test/CodeGen/X86/unaligned-load.ll5
-rw-r--r--test/FrontendC/cstring-align.c5
4 files changed, 8 insertions, 24 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 08e2ed60a3..4660e1b2cc 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -285,7 +285,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
OutStreamer.SwitchSection(TheSection);
EmitLinkage(GV->getLinkage(), GVSym);
- EmitAlignment(AlignLog, GV, AlignLog);
+ EmitAlignment(AlignLog, GV);
if (isVerbose()) {
WriteAsOperand(OutStreamer.GetCommentOS(), GV,
@@ -987,7 +987,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
unsigned Align = Log2_32(TD->getPointerPrefAlignment());
if (GV->getName() == "llvm.global_ctors") {
OutStreamer.SwitchSection(getObjFileLowering().getStaticCtorSection());
- EmitAlignment(Align);
+ EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
if (TM.getRelocationModel() == Reloc::Static &&
@@ -1001,7 +1001,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
if (GV->getName() == "llvm.global_dtors") {
OutStreamer.SwitchSection(getObjFileLowering().getStaticDtorSection());
- EmitAlignment(Align);
+ EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
if (TM.getRelocationModel() == Reloc::Static &&
diff --git a/test/CodeGen/X86/alignment.ll b/test/CodeGen/X86/alignment.ll
deleted file mode 100644
index e4ac2a072c..0000000000
--- a/test/CodeGen/X86/alignment.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: llc %s -o - -mtriple=x86_64-linux-gnu | FileCheck %s
-
-; This can get rounded up to the preferred alignment (16).
-; PR6921
-@GlobalA = global { [384 x i8] } zeroinitializer, align 8
-
-; CHECK: .bss
-; CHECK: .globl GlobalA
-; CHECK: .align 16
-; CHECK: GlobalA:
-; CHECK: .zero 384
-
-; Common variables should also get rounded up to the preferred alignment (16).
-@GlobalB = common global { [384 x i8] } zeroinitializer, align 8
-
-; CHECK: .comm GlobalB,384,16 \ No newline at end of file
diff --git a/test/CodeGen/X86/unaligned-load.ll b/test/CodeGen/X86/unaligned-load.ll
index a99af0605b..e210531068 100644
--- a/test/CodeGen/X86/unaligned-load.ll
+++ b/test/CodeGen/X86/unaligned-load.ll
@@ -28,9 +28,8 @@ return:
declare void @llvm.memcpy.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind
-; CORE2: .section
-; CORE2: .align 4
+; CORE2: .align 3
; CORE2-NEXT: _.str1:
; CORE2-NEXT: .asciz "DHRYSTONE PROGRAM, SOME STRING"
-; CORE2: .align 4
+; CORE2: .align 3
; CORE2-NEXT: _.str3:
diff --git a/test/FrontendC/cstring-align.c b/test/FrontendC/cstring-align.c
index b9ec281f56..715d0f3126 100644
--- a/test/FrontendC/cstring-align.c
+++ b/test/FrontendC/cstring-align.c
@@ -1,5 +1,6 @@
// RUN: %llvmgcc %s -c -Os -m32 -emit-llvm -o - | llc -march=x86 -mtriple=i386-apple-darwin10 | FileCheck %s -check-prefix=DARWIN32
// RUN: %llvmgcc %s -c -Os -m64 -emit-llvm -o - | llc -march=x86-64 -mtriple=x86_64-apple-darwin10 | FileCheck %s -check-prefix=DARWIN64
+// XFAIL: *
// XTARGET: darwin
extern void func(const char *, const char *);
@@ -8,10 +9,10 @@ void long_function_name() {
func("%s: the function name", __func__);
}
-// DARWIN64: .align 4
+// DARWIN64: .align 3
// DARWIN64: ___func__.
// DARWIN64: .asciz "long_function_name"
-// DARWIN32: .align 4
+// DARWIN32: .align 2
// DARWIN32: ___func__.
// DARWIN32: .asciz "long_function_name"