summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-04-23 19:58:54 +0000
committerDale Johannesen <dalej@apple.com>2007-04-23 19:58:54 +0000
commit14a28f13c88be58409aa44654ea6c14128249179 (patch)
tree60b39e5d1c961db0c8fbda71cd840a901eb8c1be
parentb5491378b16c8f0fc9fa001dffc249acec9037fc (diff)
downloadbcm5719-llvm-14a28f13c88be58409aa44654ea6c14128249179.tar.gz
bcm5719-llvm-14a28f13c88be58409aa44654ea6c14128249179.zip
make EmitAlignment work the way Chris says it should
llvm-svn: 36368
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 4dce674575c..1266179a2cd 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -579,8 +579,10 @@ void AsmPrinter::EmitString(const std::string &String) const {
//===----------------------------------------------------------------------===//
// EmitAlignment - Emit an alignment directive to the specified power of two.
+// Use the maximum of the specified alignment and the alignment from the
+// specified GlobalValue (if any).
void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
- if (GV && GV->getAlignment())
+ if (GV && GV->getAlignment() && Log2_32(GV->getAlignment()) > NumBits)
NumBits = Log2_32(GV->getAlignment());
if (NumBits == 0) return; // No need to emit alignment.
if (TAI->getAlignmentIsInBytes()) NumBits = 1 << NumBits;
OpenPOWER on IntegriCloud