diff options
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 1 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFunction.h | 10 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFunctionPass.h | 3 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 7 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 13 | ||||
-rw-r--r-- | include/llvm/CodeGen/Passes.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 10 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 37 | ||||
-rw-r--r-- | include/llvm/CodeGen/SlotIndexes.h | 6 |
9 files changed, 42 insertions, 51 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index ffeb44d..a405932 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -19,6 +19,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Support/DebugLoc.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/ADT/DenseMap.h" namespace llvm { class BlockAddress; diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 76ec9db..59b1718 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -26,7 +26,6 @@ namespace llvm { -class DILocation; class Value; class Function; class MachineRegisterInfo; @@ -112,9 +111,6 @@ class MachineFunction { // of a function. DebugLoc DefaultDebugLoc; - // Tracks debug locations. - DebugLocTracker DebugLocInfo; - /// FunctionNumber - This provides a unique ID for each function emitted in /// this translation unit. /// @@ -402,9 +398,6 @@ public: // Debug location. // - /// getDILocation - Get the DILocation for a given DebugLoc object. - DILocation getDILocation(DebugLoc DL) const; - /// getDefaultDebugLoc - Get the default debug location for the machine /// function. DebugLoc getDefaultDebugLoc() const { return DefaultDebugLoc; } @@ -412,9 +405,6 @@ public: /// setDefaultDebugLoc - Get the default debug location for the machine /// function. void setDefaultDebugLoc(DebugLoc DL) { DefaultDebugLoc = DL; } - - /// getDebugLocInfo - Get the debug info location tracker. - DebugLocTracker &getDebugLocInfo() { return DebugLocInfo; } }; //===--------------------------------------------------------------------===// diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h index bac1103..1a2b129 100644 --- a/include/llvm/CodeGen/MachineFunctionPass.h +++ b/include/llvm/CodeGen/MachineFunctionPass.h @@ -34,6 +34,9 @@ protected: explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} + /// createPrinterPass - Get a machine function printer pass. + Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; + /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. /// diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index d84f882..fa81927 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -16,12 +16,13 @@ #ifndef LLVM_CODEGEN_MACHINEINSTR_H #define LLVM_CODEGEN_MACHINEINSTR_H -#include "llvm/ADT/ilist.h" -#include "llvm/ADT/ilist_node.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/Target/TargetInstrDesc.h" #include "llvm/Target/TargetOpcodes.h" +#include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/DenseMapInfo.h" #include "llvm/Support/DebugLoc.h" #include <vector> diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index d446eae..d610390 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -37,6 +37,7 @@ #include "llvm/CodeGen/MachineLocation.h" #include "llvm/MC/MCContext.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Support/DebugLoc.h" #include "llvm/Support/ValueHandle.h" #include "llvm/System/DataTypes.h" #include "llvm/ADT/DenseMap.h" @@ -156,8 +157,8 @@ class MachineModuleInfo : public ImmutablePass { public: static char ID; // Pass identification, replacement for typeid - typedef std::pair<unsigned, TrackingVH<MDNode> > UnsignedAndMDNodePair; - typedef SmallVector< std::pair<TrackingVH<MDNode>, UnsignedAndMDNodePair>, 4> + typedef std::pair<unsigned, DebugLoc> UnsignedDebugLocPair; + typedef SmallVector<std::pair<TrackingVH<MDNode>, UnsignedDebugLocPair>, 4> VariableDbgInfoMapTy; VariableDbgInfoMapTy VariableDbgInfo; @@ -330,10 +331,10 @@ public: /// of one is required to emit exception handling info. Function *getPersonality() const; - /// setVariableDbgInfo - Collect information used to emit debugging information - /// of a variable. - void setVariableDbgInfo(MDNode *N, unsigned Slot, MDNode *Scope) { - VariableDbgInfo.push_back(std::make_pair(N, std::make_pair(Slot, Scope))); + /// setVariableDbgInfo - Collect information used to emit debugging + /// information of a variable. + void setVariableDbgInfo(MDNode *N, unsigned Slot, DebugLoc Loc) { + VariableDbgInfo.push_back(std::make_pair(N, std::make_pair(Slot, Loc))); } VariableDbgInfoMapTy &getVariableDbgInfo() { return VariableDbgInfo; } diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h index 911be22..d3c2720 100644 --- a/include/llvm/CodeGen/Passes.h +++ b/include/llvm/CodeGen/Passes.h @@ -21,6 +21,7 @@ namespace llvm { class FunctionPass; + class MachineFunctionPass; class PassInfo; class TargetLowering; class RegisterCoalescer; @@ -36,8 +37,9 @@ namespace llvm { /// MachineFunctionPrinter pass - This pass prints out the machine function to /// the given stream, as a debugging tool. - FunctionPass *createMachineFunctionPrinterPass(raw_ostream &OS, - const std::string &Banner =""); + MachineFunctionPass * + createMachineFunctionPrinterPass(raw_ostream &OS, + const std::string &Banner =""); /// MachineLoopInfo pass - This pass is a loop analysis pass. /// diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 610edb6..ef5d7e2 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -461,8 +461,7 @@ public: SDValue getCALLSEQ_START(SDValue Chain, SDValue Op) { SDVTList VTs = getVTList(MVT::Other, MVT::Flag); SDValue Ops[] = { Chain, Op }; - return getNode(ISD::CALLSEQ_START, DebugLoc::getUnknownLoc(), - VTs, Ops, 2); + return getNode(ISD::CALLSEQ_START, DebugLoc(), VTs, Ops, 2); } /// getCALLSEQ_END - Return a new CALLSEQ_END node, which always must have a @@ -476,20 +475,19 @@ public: Ops.push_back(Op1); Ops.push_back(Op2); Ops.push_back(InFlag); - return getNode(ISD::CALLSEQ_END, DebugLoc::getUnknownLoc(), NodeTys, - &Ops[0], + return getNode(ISD::CALLSEQ_END, DebugLoc(), NodeTys, &Ops[0], (unsigned)Ops.size() - (InFlag.getNode() == 0 ? 1 : 0)); } /// getUNDEF - Return an UNDEF node. UNDEF does not have a useful DebugLoc. SDValue getUNDEF(EVT VT) { - return getNode(ISD::UNDEF, DebugLoc::getUnknownLoc(), VT); + return getNode(ISD::UNDEF, DebugLoc(), VT); } /// getGLOBAL_OFFSET_TABLE - Return a GLOBAL_OFFSET_TABLE node. This does /// not have a useful DebugLoc. SDValue getGLOBAL_OFFSET_TABLE(EVT VT) { - return getNode(ISD::GLOBAL_OFFSET_TABLE, DebugLoc::getUnknownLoc(), VT); + return getNode(ISD::GLOBAL_OFFSET_TABLE, DebugLoc(), VT); } /// getNode - Gets or creates the specified node. diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 4dcf013..782d354 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1569,8 +1569,7 @@ public: #else explicit HandleSDNode(SDValue X) #endif - : SDNode(ISD::HANDLENODE, DebugLoc::getUnknownLoc(), - getSDVTList(MVT::Other)) { + : SDNode(ISD::HANDLENODE, DebugLoc(), getSDVTList(MVT::Other)) { InitOperands(&Op, X); } ~HandleSDNode(); @@ -1801,7 +1800,7 @@ class ConstantSDNode : public SDNode { friend class SelectionDAG; ConstantSDNode(bool isTarget, const ConstantInt *val, EVT VT) : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, - DebugLoc::getUnknownLoc(), getSDVTList(VT)), Value(val) { + DebugLoc(), getSDVTList(VT)), Value(val) { } public: @@ -1825,7 +1824,7 @@ class ConstantFPSDNode : public SDNode { friend class SelectionDAG; ConstantFPSDNode(bool isTarget, const ConstantFP *val, EVT VT) : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, - DebugLoc::getUnknownLoc(), getSDVTList(VT)), Value(val) { + DebugLoc(), getSDVTList(VT)), Value(val) { } public: @@ -1896,7 +1895,7 @@ class FrameIndexSDNode : public SDNode { friend class SelectionDAG; FrameIndexSDNode(int fi, EVT VT, bool isTarg) : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, - DebugLoc::getUnknownLoc(), getSDVTList(VT)), FI(fi) { + DebugLoc(), getSDVTList(VT)), FI(fi) { } public: @@ -1915,7 +1914,7 @@ class JumpTableSDNode : public SDNode { friend class SelectionDAG; JumpTableSDNode(int jti, EVT VT, bool isTarg, unsigned char TF) : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, - DebugLoc::getUnknownLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) { + DebugLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) { } public: @@ -1941,7 +1940,7 @@ class ConstantPoolSDNode : public SDNode { ConstantPoolSDNode(bool isTarget, Constant *c, EVT VT, int o, unsigned Align, unsigned char TF) : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, - DebugLoc::getUnknownLoc(), + DebugLoc(), getSDVTList(VT)), Offset(o), Alignment(Align), TargetFlags(TF) { assert((int)Offset >= 0 && "Offset is too large"); Val.ConstVal = c; @@ -1949,7 +1948,7 @@ class ConstantPoolSDNode : public SDNode { ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v, EVT VT, int o, unsigned Align, unsigned char TF) : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, - DebugLoc::getUnknownLoc(), + DebugLoc(), getSDVTList(VT)), Offset(o), Alignment(Align), TargetFlags(TF) { assert((int)Offset >= 0 && "Offset is too large"); Val.MachineCPVal = v; @@ -1997,8 +1996,7 @@ class BasicBlockSDNode : public SDNode { /// blocks out of order when they're jumped to, which makes it a bit /// harder. Let's see if we need it first. explicit BasicBlockSDNode(MachineBasicBlock *mbb) - : SDNode(ISD::BasicBlock, DebugLoc::getUnknownLoc(), - getSDVTList(MVT::Other)), MBB(mbb) { + : SDNode(ISD::BasicBlock, DebugLoc(), getSDVTList(MVT::Other)), MBB(mbb) { } public: @@ -2044,8 +2042,7 @@ class SrcValueSDNode : public SDNode { friend class SelectionDAG; /// Create a SrcValue for a general value. explicit SrcValueSDNode(const Value *v) - : SDNode(ISD::SRCVALUE, DebugLoc::getUnknownLoc(), - getSDVTList(MVT::Other)), V(v) {} + : SDNode(ISD::SRCVALUE, DebugLoc(), getSDVTList(MVT::Other)), V(v) {} public: /// getValue - return the contained Value. @@ -2062,8 +2059,7 @@ class RegisterSDNode : public SDNode { unsigned Reg; friend class SelectionDAG; RegisterSDNode(unsigned reg, EVT VT) - : SDNode(ISD::Register, DebugLoc::getUnknownLoc(), - getSDVTList(VT)), Reg(reg) { + : SDNode(ISD::Register, DebugLoc(), getSDVTList(VT)), Reg(reg) { } public: @@ -2081,7 +2077,7 @@ class BlockAddressSDNode : public SDNode { friend class SelectionDAG; BlockAddressSDNode(unsigned NodeTy, EVT VT, BlockAddress *ba, unsigned char Flags) - : SDNode(NodeTy, DebugLoc::getUnknownLoc(), getSDVTList(VT)), + : SDNode(NodeTy, DebugLoc(), getSDVTList(VT)), BA(ba), TargetFlags(Flags) { } public: @@ -2119,8 +2115,7 @@ class ExternalSymbolSDNode : public SDNode { friend class SelectionDAG; ExternalSymbolSDNode(bool isTarget, const char *Sym, unsigned char TF, EVT VT) : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, - DebugLoc::getUnknownLoc(), - getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) { + DebugLoc(), getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) { } public: @@ -2138,8 +2133,8 @@ class CondCodeSDNode : public SDNode { ISD::CondCode Condition; friend class SelectionDAG; explicit CondCodeSDNode(ISD::CondCode Cond) - : SDNode(ISD::CONDCODE, DebugLoc::getUnknownLoc(), - getSDVTList(MVT::Other)), Condition(Cond) { + : SDNode(ISD::CONDCODE, DebugLoc(), getSDVTList(MVT::Other)), + Condition(Cond) { } public: @@ -2296,8 +2291,8 @@ class VTSDNode : public SDNode { EVT ValueType; friend class SelectionDAG; explicit VTSDNode(EVT VT) - : SDNode(ISD::VALUETYPE, DebugLoc::getUnknownLoc(), - getSDVTList(MVT::Other)), ValueType(VT) { + : SDNode(ISD::VALUETYPE, DebugLoc(), getSDVTList(MVT::Other)), + ValueType(VT) { } public: diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index dd4caba..caefdf4 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -22,11 +22,11 @@ #ifndef LLVM_CODEGEN_SLOTINDEXES_H #define LLVM_CODEGEN_SLOTINDEXES_H -#include "llvm/ADT/PointerIntPair.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/MachineInstr.h" +#include "llvm/ADT/PointerIntPair.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/ErrorHandling.h" |