numbers. We recommend using with tags in the range 0x1000 thru 0x2000 (there is
a defined enum DW_TAG_user_base = 0x1000.)</p>
-<p>The fields of debug descriptors used internally by LLVM (MachineDebugInfo)
+<p>The fields of debug descriptors used internally by LLVM (MachineModuleInfo)
are restricted to only the simple data types <tt>int</tt>, <tt>uint</tt>,
<tt>bool</tt>, <tt>float</tt>, <tt>double</tt>, <tt>sbyte*</tt> and <tt> { }*
</tt>. References to arbitrary values are handled using a <tt> { }* </tt> and a
// V.3 reference manual http://dwarf.freestandards.org ,
//
// The role of the Dwarf Writer class is to extract debug information from the
-// MachineDebugInfo object, organize it in Dwarf form and then emit it into asm
+// MachineModuleInfo object, organize it in Dwarf form and then emit it into asm
// the current asm file using data and high level Dwarf directives.
//
//===----------------------------------------------------------------------===//
class AsmPrinter;
class Dwarf;
-class MachineDebugInfo;
+class MachineModuleInfo;
class MachineFunction;
class Module;
class TargetAsmInfo;
DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
virtual ~DwarfWriter();
- /// SetDebugInfo - Set DebugInfo when it's known that pass manager has
- /// created it. Set by the target AsmPrinter.
- void SetDebugInfo(MachineDebugInfo *DI);
+ /// SetModuleInfo - Set machine module info when it's known that pass manager
+ /// has created it. Set by the target AsmPrinter.
+ void SetModuleInfo(MachineModuleInfo *MMI);
//===--------------------------------------------------------------------===//
// Main entry points.
class TargetData;
class TargetRegisterClass;
class Type;
-class MachineDebugInfo;
+class MachineModuleInfo;
class MachineFunction;
/// The CalleeSavedInfo class tracks the information need to locate where a
/// handling.
std::vector<CalleeSavedInfo> CSInfo;
- /// DebugInfo - This field is set (via setMachineDebugInfo) by a debug info
+ /// MMI - This field is set (via setMachineModuleInfo) by a module info
/// consumer (ex. DwarfWriter) to indicate that frame layout information
/// should be acquired. Typically, it's the responsibility of the target's
- /// MRegisterInfo prologue/epilogue emitting code to inform MachineDebugInfo
+ /// MRegisterInfo prologue/epilogue emitting code to inform MachineModuleInfo
/// of frame layouts.
- MachineDebugInfo *DebugInfo;
+ MachineModuleInfo *MMI;
public:
MachineFrameInfo() {
HasVarSizedObjects = false;
HasCalls = false;
MaxCallFrameSize = 0;
- DebugInfo = 0;
+ MMI = 0;
}
/// hasStackObjects - Return true if there are any stack objects in this
CSInfo = CSI;
}
- /// getMachineDebugInfo - Used by a prologue/epilogue emitter (MRegisterInfo)
+ /// getMachineModuleInfo - Used by a prologue/epilogue emitter (MRegisterInfo)
/// to provide frame layout information.
- MachineDebugInfo *getMachineDebugInfo() const { return DebugInfo; }
+ MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
- /// setMachineDebugInfo - Used by a debug consumer (DwarfWriter) to indicate
- /// that frame layout information should be gathered.
- void setMachineDebugInfo(MachineDebugInfo *DI) { DebugInfo = DI; }
+ /// setMachineModuleInfo - Used by a meta info consumer (DwarfWriter) to
+ /// indicate that frame layout information should be gathered.
+ void setMachineModuleInfo(MachineModuleInfo *mmi) { MMI = mmi; }
/// print - Used by the MachineFunction printer to print information about
/// stack objects. Implemented in MachineFunction.cpp
#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
#define LLVM_CODEGEN_MACHINEFUNCTION_H
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/Support/Annotation.h"
namespace llvm {
struct InstrStage;
class MachineConstantPool;
- class MachineDebugInfo;
+ class MachineModuleInfo;
class MachineInstr;
class MRegisterInfo;
class SelectionDAG;
class AliasAnalysis;
class TargetLowering;
class TargetMachine;
- class MachineDebugInfo;
+ class MachineModuleInfo;
class MachineFunction;
class MachineConstantPoolValue;
class SelectionDAG {
TargetLowering &TLI;
MachineFunction &MF;
- MachineDebugInfo *DI;
+ MachineModuleInfo *MMI;
/// Root - The root of the entire DAG. EntryNode - The starting token.
SDOperand Root, EntryNode;
FoldingSet<SDNode> CSEMap;
public:
- SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineDebugInfo *di)
- : TLI(tli), MF(mf), DI(di) {
+ SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineModuleInfo *mmi)
+ : TLI(tli), MF(mf), MMI(mmi) {
EntryNode = Root = getNode(ISD::EntryToken, MVT::Other);
}
~SelectionDAG();
MachineFunction &getMachineFunction() const { return MF; }
const TargetMachine &getTarget() const;
TargetLowering &getTargetLoweringInfo() const { return TLI; }
- MachineDebugInfo *getMachineDebugInfo() const { return DI; }
+ MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
/// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
///
// DEBUG_LOC - This node is used to represent source line information
// embedded in the code. It takes a token chain as input, then a line
- // number, then a column then a file id (provided by MachineDebugInfo.) It
+ // number, then a column then a file id (provided by MachineModuleInfo.) It
// produces a token chain as output.
DEBUG_LOC,
SwitchToDataSection(""); // Reset back to no section.
- if (MachineDebugInfo *DebugInfo = getAnalysisToUpdate<MachineDebugInfo>()) {
- DebugInfo->AnalyzeModule(M);
+ if (MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>()) {
+ MMI->AnalyzeModule(M);
}
return false;
#define DEBUG_TYPE "branchfolding"
#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Control Flow Optimizer"; }
const TargetInstrInfo *TII;
- MachineDebugInfo *MDI;
+ MachineModuleInfo *MMI;
bool MadeChange;
private:
// Tail Merging.
MBB->removeSuccessor(MBB->succ_end()-1);
// If there is DWARF info to active, check to see if there are any LABEL
- // records in the basic block. If so, unregister them from MachineDebugInfo.
- if (MDI && !MBB->empty()) {
+ // records in the basic block. If so, unregister them from MachineModuleInfo.
+ if (MMI && !MBB->empty()) {
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
I != E; ++I) {
if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) {
// The label ID # is always operand #0, an immediate.
- MDI->InvalidateLabel(I->getOperand(0).getImm());
+ MMI->InvalidateLabel(I->getOperand(0).getImm());
}
}
}
TII = MF.getTarget().getInstrInfo();
if (!TII) return false;
- MDI = getAnalysisToUpdate<MachineDebugInfo>();
+ MMI = getAnalysisToUpdate<MachineModuleInfo>();
bool EverMadeChange = false;
bool MadeChangeThisIteration = true;
#include "llvm/Module.h"
#include "llvm/Type.h"
#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/Support/Dwarf.h"
///
MachineFunction *MF;
- /// DebugInfo - Collected debug information.
+ /// MMI - Collected machine module information.
///
- MachineDebugInfo *DebugInfo;
+ MachineModuleInfo *MMI;
/// didInitial - Flag to indicate if initial emission has been done.
///
//
/// CompileUnits - All the compile units involved in this build. The index
- /// of each entry in this vector corresponds to the sources in DebugInfo.
+ /// of each entry in this vector corresponds to the sources in MMI.
std::vector<CompileUnit *> CompileUnits;
/// AbbreviationsSet - Used to uniquely define abbreviations.
// FIXME - Ignore inlined functions for the time being.
if (!Scope->getParent()) continue;
- unsigned StartID = DebugInfo->MappedLabel(Scope->getStartLabelID());
- unsigned EndID = DebugInfo->MappedLabel(Scope->getEndLabelID());
+ unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID());
+ unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID());
// Ignore empty scopes.
if (StartID == EndID && StartID != 0) continue;
unsigned LabelID = Move.getLabelID();
if (LabelID) {
- LabelID = DebugInfo->MappedLabel(LabelID);
+ LabelID = MMI->MappedLabel(LabelID);
// Throw out move if the label is invalid.
if (!LabelID) continue;
Asm->EmitInt8(0); Asm->EOL("DW_LNS_const_add_pc arg count");
Asm->EmitInt8(1); Asm->EOL("DW_LNS_fixed_advance_pc arg count");
- const UniqueVector<std::string> &Directories = DebugInfo->getDirectories();
+ const UniqueVector<std::string> &Directories = MMI->getDirectories();
const UniqueVector<SourceFileInfo>
- &SourceFiles = DebugInfo->getSourceFiles();
+ &SourceFiles = MMI->getSourceFiles();
// Emit directories.
for (unsigned DirectoryID = 1, NDID = Directories.size();
// Construct rows of the address, source, line, column matrix.
for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
const SourceLineInfo &LineInfo = LineInfos[i];
- unsigned LabelID = DebugInfo->MappedLabel(LineInfo.getLabelID());
+ unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID());
if (!LabelID) continue;
unsigned SourceID = LineInfo.getSourceID();
"func_begin", SubprogramCount);
Asm->EOL("FDE address range");
- std::vector<MachineMove> &Moves = DebugInfo->getFrameMoves();
+ std::vector<MachineMove> &Moves = MMI->getFrameMoves();
EmitFrameMoves("func_begin", SubprogramCount, Moves);
/// ConstructCompileUnitDIEs - Create a compile unit DIE for each source and
/// header file.
void ConstructCompileUnitDIEs() {
- const UniqueVector<CompileUnitDesc *> CUW = DebugInfo->getCompileUnits();
+ const UniqueVector<CompileUnitDesc *> CUW = MMI->getCompileUnits();
for (unsigned i = 1, N = CUW.size(); i <= N; ++i) {
- unsigned ID = DebugInfo->RecordSource(CUW[i]);
+ unsigned ID = MMI->RecordSource(CUW[i]);
CompileUnit *Unit = NewCompileUnit(CUW[i], ID);
CompileUnits.push_back(Unit);
}
/// global variables.
void ConstructGlobalDIEs() {
std::vector<GlobalVariableDesc *> GlobalVariables =
- DebugInfo->getAnchoredDescriptors<GlobalVariableDesc>(*M);
+ MMI->getAnchoredDescriptors<GlobalVariableDesc>(*M);
for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) {
GlobalVariableDesc *GVD = GlobalVariables[i];
/// subprograms.
void ConstructSubprogramDIEs() {
std::vector<SubprogramDesc *> Subprograms =
- DebugInfo->getAnchoredDescriptors<SubprogramDesc>(*M);
+ MMI->getAnchoredDescriptors<SubprogramDesc>(*M);
for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) {
SubprogramDesc *SPD = Subprograms[i];
, RI(Asm->TM.getRegisterInfo())
, M(NULL)
, MF(NULL)
- , DebugInfo(NULL)
+ , MMI(NULL)
, didInitial(false)
, shouldEmit(false)
, SubprogramCount(0)
//
const TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
- /// SetDebugInfo - Set DebugInfo when it's known that pass manager has
- /// created it. Set by the target AsmPrinter.
- void SetDebugInfo(MachineDebugInfo *DI) {
+ /// SetModuleInfo - Set machine module information when it's known that pass
+ /// manager has created it. Set by the target AsmPrinter.
+ void SetModuleInfo(MachineModuleInfo *mmi) {
// Make sure initial declarations are made.
- if (!DebugInfo && DI->hasInfo()) {
- DebugInfo = DI;
+ if (!MMI && mmi->hasDebugInfo()) {
+ MMI = mmi;
shouldEmit = true;
// Emit initial sections
Asm->EOL("Dwarf Begin Function");
// Begin accumulating function debug information.
- DebugInfo->BeginFunction(MF);
+ MMI->BeginFunction(MF);
// Assumes in correct section after the entry point.
EmitLabel("func_begin", ++SubprogramCount);
EmitLabel("func_end", SubprogramCount);
// Get function line info.
- const std::vector<SourceLineInfo> &LineInfos = DebugInfo->getSourceLines();
+ const std::vector<SourceLineInfo> &LineInfos = MMI->getSourceLines();
if (!LineInfos.empty()) {
// Get section line info.
}
// Construct scopes for subprogram.
- ConstructRootScope(DebugInfo->getRootScope());
+ ConstructRootScope(MMI->getRootScope());
// Emit function frame information.
EmitFunctionDebugFrame();
// Reset the line numbers for the next function.
- DebugInfo->ClearLineInfo();
+ MMI->ClearLineInfo();
// Clear function debug information.
- DebugInfo->EndFunction();
+ MMI->EndFunction();
}
};
delete DW;
}
-/// SetDebugInfo - Set DebugInfo when it's known that pass manager has
-/// created it. Set by the target AsmPrinter.
-void DwarfWriter::SetDebugInfo(MachineDebugInfo *DI) {
- DW->SetDebugInfo(DI);
+/// SetModuleInfo - Set machine module info when it's known that pass manager
+/// has created it. Set by the target AsmPrinter.
+void DwarfWriter::SetModuleInfo(MachineModuleInfo *MMI) {
+ DW->SetModuleInfo(MMI);
}
/// BeginModule - Emit all Dwarf sections that should come prior to the
/// frame indexes with appropriate references.
///
bool runOnMachineFunction(MachineFunction &Fn) {
- // Get MachineDebugInfo so that we can track the construction of the
+ // Get MachineModuleInfo so that we can track the construction of the
// frame.
- if (MachineDebugInfo *DI = getAnalysisToUpdate<MachineDebugInfo>()) {
- Fn.getFrameInfo()->setMachineDebugInfo(DI);
+ if (MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>()) {
+ Fn.getFrameInfo()->setMachineModuleInfo(MMI);
}
// Allow the target machine to make some adjustments to the function
case TargetLowering::Promote:
default: assert(0 && "This action is not supported yet!");
case TargetLowering::Expand: {
- MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
bool useDEBUG_LOC = TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other);
bool useLABEL = TLI.isOperationLegal(ISD::LABEL, MVT::Other);
- if (DebugInfo && (useDEBUG_LOC || useLABEL)) {
+ if (MMI && (useDEBUG_LOC || useLABEL)) {
const std::string &FName =
cast<StringSDNode>(Node->getOperand(3))->getValue();
const std::string &DirName =
cast<StringSDNode>(Node->getOperand(4))->getValue();
- unsigned SrcFile = DebugInfo->RecordSource(DirName, FName);
+ unsigned SrcFile = MMI->RecordSource(DirName, FName);
SmallVector<SDOperand, 8> Ops;
Ops.push_back(Tmp1); // chain
} else {
unsigned Line = cast<ConstantSDNode>(LineOp)->getValue();
unsigned Col = cast<ConstantSDNode>(ColOp)->getValue();
- unsigned ID = DebugInfo->RecordLabel(Line, Col, SrcFile);
+ unsigned ID = MMI->RecordLabel(Line, Col, SrcFile);
Ops.push_back(DAG.getConstant(ID, MVT::i32));
Result = DAG.getNode(ISD::LABEL, MVT::Other,&Ops[0],Ops.size());
}
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/IntrinsicInst.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
return 0;
case Intrinsic::dbg_stoppoint: {
- MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
- if (DebugInfo && SPI.getContext() && DebugInfo->Verify(SPI.getContext())) {
+ if (MMI && SPI.getContext() && MMI->Verify(SPI.getContext())) {
SDOperand Ops[5];
Ops[0] = getRoot();
Ops[1] = getValue(SPI.getLineValue());
Ops[2] = getValue(SPI.getColumnValue());
- DebugInfoDesc *DD = DebugInfo->getDescFor(SPI.getContext());
+ DebugInfoDesc *DD = MMI->getDescFor(SPI.getContext());
assert(DD && "Not a debug information descriptor");
CompileUnitDesc *CompileUnit = cast<CompileUnitDesc>(DD);
return 0;
}
case Intrinsic::dbg_region_start: {
- MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
DbgRegionStartInst &RSI = cast<DbgRegionStartInst>(I);
- if (DebugInfo && RSI.getContext() && DebugInfo->Verify(RSI.getContext())) {
- unsigned LabelID = DebugInfo->RecordRegionStart(RSI.getContext());
+ if (MMI && RSI.getContext() && MMI->Verify(RSI.getContext())) {
+ unsigned LabelID = MMI->RecordRegionStart(RSI.getContext());
DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(),
DAG.getConstant(LabelID, MVT::i32)));
}
return 0;
}
case Intrinsic::dbg_region_end: {
- MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
DbgRegionEndInst &REI = cast<DbgRegionEndInst>(I);
- if (DebugInfo && REI.getContext() && DebugInfo->Verify(REI.getContext())) {
- unsigned LabelID = DebugInfo->RecordRegionEnd(REI.getContext());
+ if (MMI && REI.getContext() && MMI->Verify(REI.getContext())) {
+ unsigned LabelID = MMI->RecordRegionEnd(REI.getContext());
DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other,
getRoot(), DAG.getConstant(LabelID, MVT::i32)));
}
return 0;
}
case Intrinsic::dbg_func_start: {
- MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
DbgFuncStartInst &FSI = cast<DbgFuncStartInst>(I);
- if (DebugInfo && FSI.getSubprogram() &&
- DebugInfo->Verify(FSI.getSubprogram())) {
- unsigned LabelID = DebugInfo->RecordRegionStart(FSI.getSubprogram());
+ if (MMI && FSI.getSubprogram() &&
+ MMI->Verify(FSI.getSubprogram())) {
+ unsigned LabelID = MMI->RecordRegionStart(FSI.getSubprogram());
DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other,
getRoot(), DAG.getConstant(LabelID, MVT::i32)));
}
return 0;
}
case Intrinsic::dbg_declare: {
- MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
- if (DebugInfo && DI.getVariable() && DebugInfo->Verify(DI.getVariable())) {
+ if (MMI && DI.getVariable() && MMI->Verify(DI.getVariable())) {
SDOperand AddressOp = getValue(DI.getAddress());
if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(AddressOp))
- DebugInfo->RecordVariable(DI.getVariable(), FI->getIndex());
+ MMI->RecordVariable(DI.getVariable(), FI->getIndex());
}
return 0;
FunctionLoweringInfo &FuncInfo) {
std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate;
{
- SelectionDAG DAG(TLI, MF, getAnalysisToUpdate<MachineDebugInfo>());
+ SelectionDAG DAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
CurDAG = &DAG;
// First step, lower LLVM code to some DAG. This DAG may use operations and
// whether the PHI is a successor of the range check MBB or the jump table MBB
if (JT.Reg) {
assert(SwitchCases.empty() && "Cannot have jump table and lowered switch");
- SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate<MachineDebugInfo>());
+ SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
CurDAG = &SDAG;
SelectionDAGLowering SDL(SDAG, TLI, FuncInfo);
MachineBasicBlock *RangeBB = BB;
// If we generated any switch lowering information, build and codegen any
// additional DAGs necessary.
for (unsigned i = 0, e = SwitchCases.size(); i != e; ++i) {
- SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate<MachineDebugInfo>());
+ SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate<MachineModuleInfo>());
CurDAG = &SDAG;
SelectionDAGLowering SDL(SDAG, TLI, FuncInfo);
#include "llvm/Module.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Target/TargetAsmInfo.h"
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
- AU.addRequired<MachineDebugInfo>();
+ AU.addRequired<MachineModuleInfo>();
}
};
} // end of anonymous namespace
AFI = MF.getInfo<ARMFunctionInfo>();
if (Subtarget->isTargetDarwin()) {
- DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
}
SetupMachineFunction(MF);
#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/Support/Mangler.h"
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
- AU.addRequired<MachineDebugInfo>();
+ AU.addRequired<MachineModuleInfo>();
PPCAsmPrinter::getAnalysisUsage(AU);
}
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
- AU.addRequired<MachineDebugInfo>();
+ AU.addRequired<MachineModuleInfo>();
PPCAsmPrinter::getAnalysisUsage(AU);
}
/// method to print assembly for each instruction.
///
bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
SetupMachineFunction(MF);
O << "\n\n";
/// method to print assembly for each instruction.
///
bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
SetupMachineFunction(MF);
O << "\n\n";
#include "llvm/Type.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineLocation.h"
MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
MachineBasicBlock::iterator MBBI = MBB.begin();
MachineFrameInfo *MFI = MF.getFrameInfo();
- MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo();
+ MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
// Prepare for debug frame info.
- bool hasInfo = DebugInfo && DebugInfo->hasInfo();
+ bool hasDebugInfo = MMI && MMI->hasDebugInfo();
unsigned FrameLabelId = 0;
// Scan the prolog, looking for an UPDATE_VRSAVE instruction. If we find it,
unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
unsigned MaxAlign = MFI->getMaxAlignment();
- if (hasInfo) {
+ if (hasDebugInfo) {
// Mark effective beginning of when frame pointer becomes valid.
- FrameLabelId = DebugInfo->NextLabelID();
+ FrameLabelId = MMI->NextLabelID();
BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId);
}
}
}
- if (hasInfo) {
- std::vector<MachineMove> &Moves = DebugInfo->getFrameMoves();
+ if (hasDebugInfo) {
+ std::vector<MachineMove> &Moves = MMI->getFrameMoves();
if (NegFrameSize) {
// Show update of SP.
}
// Mark effective beginning of when frame pointer is ready.
- unsigned ReadyLabelId = DebugInfo->NextLabelID();
+ unsigned ReadyLabelId = MMI->NextLabelID();
BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(ReadyLabelId);
MachineLocation FPDst(HasFP ? (IsPPC64 ? PPC::X31 : PPC::R31) :
Subtarget->isTargetELF() ||
Subtarget->isTargetCygMing()) {
// Let PassManager know we need debug information and relay
- // the MachineDebugInfo address on to DwarfWriter.
- DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+ // the MachineModuleInfo address on to DwarfWriter.
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
}
SetupMachineFunction(MF);
#include "X86TargetMachine.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/Support/Compiler.h"
#include <set>
if (Subtarget->isTargetDarwin() ||
Subtarget->isTargetELF() ||
Subtarget->isTargetCygMing()) {
- AU.addRequired<MachineDebugInfo>();
+ AU.addRequired<MachineModuleInfo>();
}
MachineFunctionPass::getAnalysisUsage(AU);
}
const Function* Fn = MF.getFunction();
const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget<X86Subtarget>();
MachineInstr *MI;
- MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo();
+ MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
// Prepare for debug frame info.
- bool hasInfo = DebugInfo && DebugInfo->hasInfo();
+ bool hasDebugInfo = MMI && MMI->hasDebugInfo();
unsigned FrameLabelId = 0;
// Get the number of bytes to allocate from the FrameInfo
}
}
- if (hasInfo) {
+ if (hasDebugInfo) {
// Mark effective beginning of when frame pointer becomes valid.
- FrameLabelId = DebugInfo->NextLabelID();
+ FrameLabelId = MMI->NextLabelID();
BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId);
}
MBB.insert(MBBI, MI);
}
- if (hasInfo) {
- std::vector<MachineMove> &Moves = DebugInfo->getFrameMoves();
+ if (hasDebugInfo) {
+ std::vector<MachineMove> &Moves = MMI->getFrameMoves();
if (NumBytes) {
// Show update of SP.
}
// Mark effective beginning of when frame pointer is ready.
- unsigned ReadyLabelId = DebugInfo->NextLabelID();
+ unsigned ReadyLabelId = MMI->NextLabelID();
BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(ReadyLabelId);
MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr);
// attribute((used)).
ExternalNames.insert("llvm.used");
- // Never internalize anchors used by the debugger, else the debugger won't
- // find them. (see MachineDebugInfo.)
+ // Never internalize anchors used by the machine module info, else the info
+ // won't find them. (see MachineModuleInfo.)
ExternalNames.insert("llvm.dbg.compile_units");
ExternalNames.insert("llvm.dbg.global_variables");
ExternalNames.insert("llvm.dbg.subprograms");
#include "llvm/IntrinsicInst.h"
#include "llvm/Constants.h"
#include "llvm/GlobalVariable.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
using namespace llvm;
//===----------------------------------------------------------------------===//