diff options
| author | Jim Laskey <jlaskey@mac.com> | 2006-04-10 23:09:19 +0000 | 
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2006-04-10 23:09:19 +0000 | 
| commit | dca2655daabe18b0c539900b431a7258169cb7d5 (patch) | |
| tree | d8ca5c94ef0e7d34e13c8011856c1e634301149a | |
| parent | 2d37f920ad67dc34955e6ab7df3907240b0c9040 (diff) | |
| download | bcm5719-llvm-dca2655daabe18b0c539900b431a7258169cb7d5.tar.gz bcm5719-llvm-dca2655daabe18b0c539900b431a7258169cb7d5.zip | |
Use existing information.
llvm-svn: 27574
| -rw-r--r-- | llvm/include/llvm/Target/MRegisterInfo.h | 5 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/DwarfWriter.cpp | 17 | ||||
| -rw-r--r-- | llvm/lib/Target/MRegisterInfo.cpp | 7 | 
3 files changed, 14 insertions, 15 deletions
| diff --git a/llvm/include/llvm/Target/MRegisterInfo.h b/llvm/include/llvm/Target/MRegisterInfo.h index 00d9d6b39f9..064a1b54111 100644 --- a/llvm/include/llvm/Target/MRegisterInfo.h +++ b/llvm/include/llvm/Target/MRegisterInfo.h @@ -359,11 +359,6 @@ public:    /// address can be found.    virtual unsigned getRARegister() const = 0; -  /// getStackDirection - This method should return the factor by which stacks -  /// grow.  The tyical value is -4 which is the grows negatively in 4 byte -  /// increments. -  virtual int getStackDirection() const; -      /// getLocation - This method should return the actual location of a frame    /// variable given the frame index.  The location is returned in ML.    /// Subclasses should override this method for special handling of frame diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp index fb4c65daab7..bb41dc03548 100644 --- a/llvm/lib/CodeGen/DwarfWriter.cpp +++ b/llvm/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; diff --git a/llvm/lib/Target/MRegisterInfo.cpp b/llvm/lib/Target/MRegisterInfo.cpp index 4ddfe9f3230..920bb5d3af3 100644 --- a/llvm/lib/Target/MRegisterInfo.cpp +++ b/llvm/lib/Target/MRegisterInfo.cpp @@ -44,13 +44,6 @@ std::vector<bool> MRegisterInfo::getAllocatableSet(MachineFunction &MF) const {    return Allocatable;  } -/// getStackDirection - This method should return the factor by which stacks -/// grow.  The tyical value is -4 which is the grows negatively in 4 byte -/// increments. -int MRegisterInfo::getStackDirection() const { -  return -sizeof(int32_t); -} -  /// getLocation - This method should return the actual location of a frame  /// variable given the frame index.  The location is returned in ML.  /// Subclasses should override this method for special handling of frame | 

