aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfWriter.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-04-10 23:09:19 +0000
committerJim Laskey <jlaskey@mac.com>2006-04-10 23:09:19 +0000
commit1069fbdd2fc637321ca69f501b8af4f321aeb9f7 (patch)
tree6e62b440d55e73b3524a21f640a73b2b9e43220e /lib/CodeGen/DwarfWriter.cpp
parent389a6f58f7d07930eaf4865b17a0682b0ee4c488 (diff)
Use existing information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27574 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index fb4c65daab..bb41dc0354 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -25,6 +25,7 @@
#include "llvm/Support/Mangler.h"
#include "llvm/Target/MRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetFrameInfo.h"
#include <iostream>
@@ -1829,8 +1830,13 @@ void DwarfWriter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister()));
EOL("Register");
}
-
- EmitULEB128Bytes(Src.getOffset() / RI->getStackDirection());
+
+ int stackGrowth =
+ Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
+ TargetFrameInfo::StackGrowsUp ?
+ AddressSize : -AddressSize;
+
+ EmitULEB128Bytes(Src.getOffset() / stackGrowth);
EOL("Offset");
} else {
}
@@ -2049,6 +2055,11 @@ void DwarfWriter::EmitDebugLines() const {
/// EmitInitialDebugFrame - Emit common frame info into a debug frame section.
///
void DwarfWriter::EmitInitialDebugFrame() {
+ int stackGrowth =
+ Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
+ TargetFrameInfo::StackGrowsUp ?
+ AddressSize : -AddressSize;
+
// Start the dwarf frame section.
Asm->SwitchSection(DwarfFrameSection, 0);
@@ -2061,7 +2072,7 @@ void DwarfWriter::EmitInitialDebugFrame() {
EmitInt8(DW_CIE_VERSION); EOL("CIE Version");
EmitString(""); EOL("CIE Augmentation");
EmitULEB128Bytes(1); EOL("CIE Code Alignment Factor");
- EmitSLEB128Bytes(RI->getStackDirection()); EOL("CIE Data Alignment Factor");
+ EmitSLEB128Bytes(stackGrowth); EOL("CIE Data Alignment Factor");
EmitInt8(RI->getDwarfRegNum(RI->getRARegister())); EOL("CIE RA Column");
std::vector<MachineMove *> Moves;