aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2007-01-24 13:12:32 +0000
committerJim Laskey <jlaskey@mac.com>2007-01-24 13:12:32 +0000
commitf9e56198a39a08272c072211722b3c97ef88853c (patch)
treec8c0df7a3936cf8d72bcefc6a51fa652753bf9d0
parent012f2d97b78e4eb9128f1d491f2c177768dbe527 (diff)
Use asm printer to emit alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33485 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h2
-rw-r--r--lib/CodeGen/DwarfWriter.cpp10
2 files changed, 4 insertions, 8 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index 2f54d6de74..1c660d6769 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -174,12 +174,14 @@ namespace llvm {
/// do nothing and return false.
bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
+ public:
/// EmitAlignment - Emit an alignment directive to the specified power of
/// two boundary. For example, if you pass in 3 here, you will get an 8
/// byte alignment. If a global value is specified, and if that global has
/// an explicit alignment requested, it will override the alignment request.
void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0) const;
+ protected:
/// EmitZeros - Emit a block of zeros.
///
void EmitZeros(uint64_t NumZeros) const;
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 153d96ffb4..bdf91fda06 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -945,12 +945,6 @@ public:
O << "\n";
}
- /// EmitAlign - Print a align directive.
- ///
- void EmitAlign(unsigned Alignment) const {
- O << TAI->getAlignDirective() << Alignment << "\n";
- }
-
/// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
/// unsigned leb128 value.
void EmitULEB128Bytes(unsigned Value) const {
@@ -2444,7 +2438,7 @@ private:
EmitFrameMoves(NULL, 0, Moves);
for (unsigned i = 0, N = Moves.size(); i < N; ++i) delete Moves[i];
- EmitAlign(2);
+ Asm->EmitAlignment(2);
EmitLabel("frame_common_end", 0);
O << "\n";
@@ -2477,7 +2471,7 @@ private:
EmitFrameMoves("func_begin", SubprogramCount, Moves);
- EmitAlign(2);
+ Asm->EmitAlignment(2);
EmitLabel("frame_end", SubprogramCount);
O << "\n";