Revert "For the dwarf expression code get the subtarget off of the current"

This reverts commit 230990 because also reverting 230975.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2015-03-02 20:01:47 +00:00
parent 955419ebf0
commit db52ec3ae9
2 changed files with 6 additions and 8 deletions

View File

@@ -16,7 +16,6 @@
#include "DwarfExpression.h" #include "DwarfExpression.h"
#include "llvm/ADT/Twine.h" #include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/IR/DataLayout.h" #include "llvm/IR/DataLayout.h"
#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
@@ -192,7 +191,7 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
/// EmitDwarfRegOp - Emit dwarf register operation. /// EmitDwarfRegOp - Emit dwarf register operation.
void AsmPrinter::EmitDwarfRegOp(ByteStreamer &Streamer, void AsmPrinter::EmitDwarfRegOp(ByteStreamer &Streamer,
const MachineLocation &MLoc) const { const MachineLocation &MLoc) const {
DebugLocDwarfExpression Expr(*MF->getSubtarget().getRegisterInfo(), DebugLocDwarfExpression Expr(*TM.getSubtargetImpl()->getRegisterInfo(),
getDwarfDebug()->getDwarfVersion(), Streamer); getDwarfDebug()->getDwarfVersion(), Streamer);
const MCRegisterInfo *MRI = MMI->getContext().getRegisterInfo(); const MCRegisterInfo *MRI = MMI->getContext().getRegisterInfo();
int Reg = MRI->getDwarfRegNum(MLoc.getReg(), false); int Reg = MRI->getDwarfRegNum(MLoc.getReg(), false);

View File

@@ -17,7 +17,6 @@
#include "DwarfDebug.h" #include "DwarfDebug.h"
#include "DwarfExpression.h" #include "DwarfExpression.h"
#include "llvm/ADT/APFloat.h" #include "llvm/ADT/APFloat.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/IR/Constants.h" #include "llvm/IR/Constants.h"
#include "llvm/IR/DIBuilder.h" #include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DataLayout.h" #include "llvm/IR/DataLayout.h"
@@ -44,11 +43,11 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
cl::desc("Generate DWARF4 type units."), cl::desc("Generate DWARF4 type units."),
cl::init(false)); cl::init(false));
DIEDwarfExpression::DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, DIEDwarfExpression::DIEDwarfExpression(const AsmPrinter &AP,
DIELoc &DIE) DwarfUnit &DU, DIELoc &DIE)
: DwarfExpression(*AP.MF->getSubtarget().getRegisterInfo(), : DwarfExpression(*AP.TM.getSubtargetImpl()->getRegisterInfo(),
AP.getDwarfDebug()->getDwarfVersion()), AP.getDwarfDebug()->getDwarfVersion()),
AP(AP), DU(DU), DIE(DIE) {} AP(AP), DU(DU), DIE(DIE) {}
void DIEDwarfExpression::EmitOp(uint8_t Op, const char* Comment) { void DIEDwarfExpression::EmitOp(uint8_t Op, const char* Comment) {
DU.addUInt(DIE, dwarf::DW_FORM_data1, Op); DU.addUInt(DIE, dwarf::DW_FORM_data1, Op);