From 44c3b9fdd416c79f4b67cde1aecfced5921efd81 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Fri, 26 Jan 2007 21:22:28 +0000 Subject: [PATCH] Change the MachineDebugInfo to MachineModuleInfo to better reflect usage for debugging and exception handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/SourceLevelDebugging.html | 2 +- include/llvm/CodeGen/DwarfWriter.h | 10 ++-- include/llvm/CodeGen/MachineFrameInfo.h | 20 +++---- include/llvm/CodeGen/MachineFunction.h | 2 +- include/llvm/CodeGen/ScheduleDAG.h | 2 +- include/llvm/CodeGen/SelectionDAG.h | 10 ++-- include/llvm/CodeGen/SelectionDAGNodes.h | 2 +- lib/CodeGen/AsmPrinter.cpp | 4 +- lib/CodeGen/BranchFolding.cpp | 12 ++-- lib/CodeGen/DwarfWriter.cpp | 60 +++++++++---------- lib/CodeGen/PrologEpilogInserter.cpp | 6 +- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 8 +-- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 40 ++++++------- lib/Target/ARM/ARMAsmPrinter.cpp | 6 +- lib/Target/PowerPC/PPCAsmPrinter.cpp | 10 ++-- lib/Target/PowerPC/PPCRegisterInfo.cpp | 16 ++--- lib/Target/X86/X86ATTAsmPrinter.cpp | 4 +- lib/Target/X86/X86AsmPrinter.h | 4 +- lib/Target/X86/X86RegisterInfo.cpp | 14 ++--- lib/Transforms/IPO/Internalize.cpp | 4 +- lib/VMCore/IntrinsicInst.cpp | 2 +- 21 files changed, 119 insertions(+), 119 deletions(-) diff --git a/docs/SourceLevelDebugging.html b/docs/SourceLevelDebugging.html index 2dc1d9079ef..02a506695c8 100644 --- a/docs/SourceLevelDebugging.html +++ b/docs/SourceLevelDebugging.html @@ -281,7 +281,7 @@ source-language is allowed to define its own objects, by using unreserved tag numbers. We recommend using with tags in the range 0x1000 thru 0x2000 (there is a defined enum DW_TAG_user_base = 0x1000.)

-

The fields of debug descriptors used internally by LLVM (MachineDebugInfo) +

The fields of debug descriptors used internally by LLVM (MachineModuleInfo) are restricted to only the simple data types int, uint, bool, float, double, sbyte* and { }* . References to arbitrary values are handled using a { }* and a diff --git a/include/llvm/CodeGen/DwarfWriter.h b/include/llvm/CodeGen/DwarfWriter.h index 22417875a5d..ae022be3e7d 100644 --- a/include/llvm/CodeGen/DwarfWriter.h +++ b/include/llvm/CodeGen/DwarfWriter.h @@ -12,7 +12,7 @@ // 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. // //===----------------------------------------------------------------------===// @@ -26,7 +26,7 @@ namespace llvm { class AsmPrinter; class Dwarf; -class MachineDebugInfo; +class MachineModuleInfo; class MachineFunction; class Module; class TargetAsmInfo; @@ -46,9 +46,9 @@ public: 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. diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h index 1f111abe514..6f13eec6876 100644 --- a/include/llvm/CodeGen/MachineFrameInfo.h +++ b/include/llvm/CodeGen/MachineFrameInfo.h @@ -17,7 +17,7 @@ namespace llvm { class TargetData; class TargetRegisterClass; class Type; -class MachineDebugInfo; +class MachineModuleInfo; class MachineFunction; /// The CalleeSavedInfo class tracks the information need to locate where a @@ -147,12 +147,12 @@ class MachineFrameInfo { /// handling. std::vector 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() { @@ -160,7 +160,7 @@ public: HasVarSizedObjects = false; HasCalls = false; MaxCallFrameSize = 0; - DebugInfo = 0; + MMI = 0; } /// hasStackObjects - Return true if there are any stack objects in this @@ -299,13 +299,13 @@ public: 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 diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index c393b07aaf3..3b4de3fc302 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -18,7 +18,7 @@ #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" diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h index 5b96f02a6cb..55b0d9f04a2 100644 --- a/include/llvm/CodeGen/ScheduleDAG.h +++ b/include/llvm/CodeGen/ScheduleDAG.h @@ -22,7 +22,7 @@ namespace llvm { struct InstrStage; class MachineConstantPool; - class MachineDebugInfo; + class MachineModuleInfo; class MachineInstr; class MRegisterInfo; class SelectionDAG; diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 2622098416b..253d574ac55 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -29,7 +29,7 @@ namespace llvm { class AliasAnalysis; class TargetLowering; class TargetMachine; - class MachineDebugInfo; + class MachineModuleInfo; class MachineFunction; class MachineConstantPoolValue; @@ -47,7 +47,7 @@ namespace llvm { class SelectionDAG { TargetLowering &TLI; MachineFunction &MF; - MachineDebugInfo *DI; + MachineModuleInfo *MMI; /// Root - The root of the entire DAG. EntryNode - The starting token. SDOperand Root, EntryNode; @@ -60,8 +60,8 @@ class SelectionDAG { FoldingSet 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(); @@ -69,7 +69,7 @@ public: 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'. /// diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 670bb7c7abd..faa0e35da00 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -506,7 +506,7 @@ namespace ISD { // 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, diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index e2935804fc9..27700ba319c 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -102,8 +102,8 @@ bool AsmPrinter::doInitialization(Module &M) { SwitchToDataSection(""); // Reset back to no section. - if (MachineDebugInfo *DebugInfo = getAnalysisToUpdate()) { - DebugInfo->AnalyzeModule(M); + if (MachineModuleInfo *MMI = getAnalysisToUpdate()) { + MMI->AnalyzeModule(M); } return false; diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index efc382bcfa5..10262f28544 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -18,7 +18,7 @@ #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" @@ -40,7 +40,7 @@ namespace { 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. @@ -75,13 +75,13 @@ void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) { 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()); } } } @@ -94,7 +94,7 @@ bool BranchFolder::runOnMachineFunction(MachineFunction &MF) { TII = MF.getTarget().getInstrInfo(); if (!TII) return false; - MDI = getAnalysisToUpdate(); + MMI = getAnalysisToUpdate(); bool EverMadeChange = false; bool MadeChangeThisIteration = true; diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 15386048058..45d65c781fc 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -19,7 +19,7 @@ #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" @@ -786,9 +786,9 @@ private: /// 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. /// @@ -807,7 +807,7 @@ private: // /// 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 CompileUnits; /// AbbreviationsSet - Used to uniquely define abbreviations. @@ -1702,8 +1702,8 @@ private: // 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; @@ -1933,7 +1933,7 @@ private: 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; @@ -2120,9 +2120,9 @@ private: 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 &Directories = DebugInfo->getDirectories(); + const UniqueVector &Directories = MMI->getDirectories(); const UniqueVector - &SourceFiles = DebugInfo->getSourceFiles(); + &SourceFiles = MMI->getSourceFiles(); // Emit directories. for (unsigned DirectoryID = 1, NDID = Directories.size(); @@ -2162,7 +2162,7 @@ private: // 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(); @@ -2295,7 +2295,7 @@ private: "func_begin", SubprogramCount); Asm->EOL("FDE address range"); - std::vector &Moves = DebugInfo->getFrameMoves(); + std::vector &Moves = MMI->getFrameMoves(); EmitFrameMoves("func_begin", SubprogramCount, Moves); @@ -2433,10 +2433,10 @@ private: /// ConstructCompileUnitDIEs - Create a compile unit DIE for each source and /// header file. void ConstructCompileUnitDIEs() { - const UniqueVector CUW = DebugInfo->getCompileUnits(); + const UniqueVector 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); } @@ -2446,7 +2446,7 @@ private: /// global variables. void ConstructGlobalDIEs() { std::vector GlobalVariables = - DebugInfo->getAnchoredDescriptors(*M); + MMI->getAnchoredDescriptors(*M); for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) { GlobalVariableDesc *GVD = GlobalVariables[i]; @@ -2458,7 +2458,7 @@ private: /// subprograms. void ConstructSubprogramDIEs() { std::vector Subprograms = - DebugInfo->getAnchoredDescriptors(*M); + MMI->getAnchoredDescriptors(*M); for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) { SubprogramDesc *SPD = Subprograms[i]; @@ -2482,7 +2482,7 @@ public: , RI(Asm->TM.getRegisterInfo()) , M(NULL) , MF(NULL) - , DebugInfo(NULL) + , MMI(NULL) , didInitial(false) , shouldEmit(false) , SubprogramCount(0) @@ -2508,12 +2508,12 @@ public: // 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 @@ -2600,7 +2600,7 @@ public: 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); @@ -2616,7 +2616,7 @@ public: EmitLabel("func_end", SubprogramCount); // Get function line info. - const std::vector &LineInfos = DebugInfo->getSourceLines(); + const std::vector &LineInfos = MMI->getSourceLines(); if (!LineInfos.empty()) { // Get section line info. @@ -2629,16 +2629,16 @@ public: } // 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(); } }; @@ -2948,10 +2948,10 @@ DwarfWriter::~DwarfWriter() { 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 diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index 6c3e2d041c0..d81ec8bea21 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -38,10 +38,10 @@ namespace { /// 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()) { - Fn.getFrameInfo()->setMachineDebugInfo(DI); + if (MachineModuleInfo *MMI = getAnalysisToUpdate()) { + Fn.getFrameInfo()->setMachineModuleInfo(MMI); } // Allow the target machine to make some adjustments to the function diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 3a8fe7a5e6a..5f5f0d360f1 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -735,16 +735,16 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { 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(Node->getOperand(3))->getValue(); const std::string &DirName = cast(Node->getOperand(4))->getValue(); - unsigned SrcFile = DebugInfo->RecordSource(DirName, FName); + unsigned SrcFile = MMI->RecordSource(DirName, FName); SmallVector Ops; Ops.push_back(Tmp1); // chain @@ -759,7 +759,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { } else { unsigned Line = cast(LineOp)->getValue(); unsigned Col = cast(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()); } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 748dae8789f..12c5d8e18d7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -24,7 +24,7 @@ #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" @@ -1954,16 +1954,16 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; case Intrinsic::dbg_stoppoint: { - MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); + MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); DbgStopPointInst &SPI = cast(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(DD); @@ -1976,10 +1976,10 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; } case Intrinsic::dbg_region_start: { - MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); + MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); DbgRegionStartInst &RSI = cast(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))); } @@ -1987,10 +1987,10 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; } case Intrinsic::dbg_region_end: { - MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); + MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); DbgRegionEndInst &REI = cast(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))); } @@ -1998,11 +1998,11 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; } case Intrinsic::dbg_func_start: { - MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); + MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); DbgFuncStartInst &FSI = cast(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))); } @@ -2010,12 +2010,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; } case Intrinsic::dbg_declare: { - MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); + MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); DbgDeclareInst &DI = cast(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(AddressOp)) - DebugInfo->RecordVariable(DI.getVariable(), FI->getIndex()); + MMI->RecordVariable(DI.getVariable(), FI->getIndex()); } return 0; @@ -4128,7 +4128,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, FunctionLoweringInfo &FuncInfo) { std::vector > PHINodesToUpdate; { - SelectionDAG DAG(TLI, MF, getAnalysisToUpdate()); + SelectionDAG DAG(TLI, MF, getAnalysisToUpdate()); CurDAG = &DAG; // First step, lower LLVM code to some DAG. This DAG may use operations and @@ -4157,7 +4157,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, // 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()); + SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate()); CurDAG = &SDAG; SelectionDAGLowering SDL(SDAG, TLI, FuncInfo); MachineBasicBlock *RangeBB = BB; @@ -4201,7 +4201,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, // 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()); + SelectionDAG SDAG(TLI, MF, getAnalysisToUpdate()); CurDAG = &SDAG; SelectionDAGLowering SDL(SDAG, TLI, FuncInfo); diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index de12dfa7c95..1fba4e1ebd4 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -23,7 +23,7 @@ #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" @@ -142,7 +142,7 @@ namespace { void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addRequired(); + AU.addRequired(); } }; } // end of anonymous namespace @@ -166,7 +166,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { AFI = MF.getInfo(); if (Subtarget->isTargetDarwin()) { - DW.SetDebugInfo(&getAnalysis()); + DW.SetModuleInfo(&getAnalysis()); } SetupMachineFunction(MF); diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 81926edb6a5..3945d1ac372 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -27,7 +27,7 @@ #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" @@ -302,7 +302,7 @@ namespace { void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addRequired(); + AU.addRequired(); PPCAsmPrinter::getAnalysisUsage(AU); } @@ -332,7 +332,7 @@ namespace { void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addRequired(); + AU.addRequired(); PPCAsmPrinter::getAnalysisUsage(AU); } @@ -528,7 +528,7 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) { /// method to print assembly for each instruction. /// bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - DW.SetDebugInfo(&getAnalysis()); + DW.SetModuleInfo(&getAnalysis()); SetupMachineFunction(MF); O << "\n\n"; @@ -738,7 +738,7 @@ std::string DarwinAsmPrinter::getSectionForFunction(const Function &F) const { /// method to print assembly for each instruction. /// bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - DW.SetDebugInfo(&getAnalysis()); + DW.SetModuleInfo(&getAnalysis()); SetupMachineFunction(MF); O << "\n\n"; diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp index 75c92615ea5..9228b3e68ec 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp @@ -22,7 +22,7 @@ #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" @@ -754,10 +754,10 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { 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, @@ -819,9 +819,9 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { 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); } @@ -870,8 +870,8 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { } } - if (hasInfo) { - std::vector &Moves = DebugInfo->getFrameMoves(); + if (hasDebugInfo) { + std::vector &Moves = MMI->getFrameMoves(); if (NegFrameSize) { // Show update of SP. @@ -901,7 +901,7 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { } // 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) : diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp index 6a07f904994..92abfc5947f 100755 --- a/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -75,8 +75,8 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { Subtarget->isTargetELF() || Subtarget->isTargetCygMing()) { // Let PassManager know we need debug information and relay - // the MachineDebugInfo address on to DwarfWriter. - DW.SetDebugInfo(&getAnalysis()); + // the MachineModuleInfo address on to DwarfWriter. + DW.SetModuleInfo(&getAnalysis()); } SetupMachineFunction(MF); diff --git a/lib/Target/X86/X86AsmPrinter.h b/lib/Target/X86/X86AsmPrinter.h index 87f1852b157..abbedf249d8 100755 --- a/lib/Target/X86/X86AsmPrinter.h +++ b/lib/Target/X86/X86AsmPrinter.h @@ -21,7 +21,7 @@ #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 @@ -61,7 +61,7 @@ struct VISIBILITY_HIDDEN X86SharedAsmPrinter : public AsmPrinter { if (Subtarget->isTargetDarwin() || Subtarget->isTargetELF() || Subtarget->isTargetCygMing()) { - AU.addRequired(); + AU.addRequired(); } MachineFunctionPass::getAnalysisUsage(AU); } diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 4b13dac63c9..e6500bc2a6c 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -995,10 +995,10 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { const Function* Fn = MF.getFunction(); const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget(); 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 @@ -1023,9 +1023,9 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { } } - 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); } @@ -1053,8 +1053,8 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { MBB.insert(MBBI, MI); } - if (hasInfo) { - std::vector &Moves = DebugInfo->getFrameMoves(); + if (hasDebugInfo) { + std::vector &Moves = MMI->getFrameMoves(); if (NumBytes) { // Show update of SP. @@ -1077,7 +1077,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { } // 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); diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index bf99235fb8b..e5bacf611af 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -120,8 +120,8 @@ bool InternalizePass::runOnModule(Module &M) { // 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"); diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/VMCore/IntrinsicInst.cpp index dbd3c8caa61..8673434323f 100644 --- a/lib/VMCore/IntrinsicInst.cpp +++ b/lib/VMCore/IntrinsicInst.cpp @@ -28,7 +28,7 @@ #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; //===----------------------------------------------------------------------===// -- 2.34.1