1*9880d681SAndroid Build Coastguard Worker //===-- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework ------*- C++ -*--===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker // 10*9880d681SAndroid Build Coastguard Worker // This file contains support for writing dwarf debug info into asm files. 11*9880d681SAndroid Build Coastguard Worker // 12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H 15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker #include "DbgValueHistoryCalculator.h" 18*9880d681SAndroid Build Coastguard Worker #include "DebugHandlerBase.h" 19*9880d681SAndroid Build Coastguard Worker #include "DebugLocStream.h" 20*9880d681SAndroid Build Coastguard Worker #include "DwarfAccelTable.h" 21*9880d681SAndroid Build Coastguard Worker #include "DwarfFile.h" 22*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/DenseMap.h" 23*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/DenseSet.h" 24*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/MapVector.h" 25*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/SmallPtrSet.h" 26*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/StringMap.h" 27*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/DIE.h" 28*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/LexicalScopes.h" 29*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/MachineInstr.h" 30*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/DebugInfo.h" 31*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/DebugLoc.h" 32*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCDwarf.h" 33*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MachineLocation.h" 34*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Allocator.h" 35*9880d681SAndroid Build Coastguard Worker #include "llvm/Target/TargetOptions.h" 36*9880d681SAndroid Build Coastguard Worker #include <memory> 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Worker namespace llvm { 39*9880d681SAndroid Build Coastguard Worker 40*9880d681SAndroid Build Coastguard Worker class AsmPrinter; 41*9880d681SAndroid Build Coastguard Worker class ByteStreamer; 42*9880d681SAndroid Build Coastguard Worker class ConstantInt; 43*9880d681SAndroid Build Coastguard Worker class ConstantFP; 44*9880d681SAndroid Build Coastguard Worker class DebugLocEntry; 45*9880d681SAndroid Build Coastguard Worker class DwarfCompileUnit; 46*9880d681SAndroid Build Coastguard Worker class DwarfDebug; 47*9880d681SAndroid Build Coastguard Worker class DwarfTypeUnit; 48*9880d681SAndroid Build Coastguard Worker class DwarfUnit; 49*9880d681SAndroid Build Coastguard Worker class MachineModuleInfo; 50*9880d681SAndroid Build Coastguard Worker 51*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 52*9880d681SAndroid Build Coastguard Worker /// This class is used to track local variable information. 53*9880d681SAndroid Build Coastguard Worker /// 54*9880d681SAndroid Build Coastguard Worker /// Variables can be created from allocas, in which case they're generated from 55*9880d681SAndroid Build Coastguard Worker /// the MMI table. Such variables can have multiple expressions and frame 56*9880d681SAndroid Build Coastguard Worker /// indices. The \a Expr and \a FrameIndices array must match. 57*9880d681SAndroid Build Coastguard Worker /// 58*9880d681SAndroid Build Coastguard Worker /// Variables can be created from \c DBG_VALUE instructions. Those whose 59*9880d681SAndroid Build Coastguard Worker /// location changes over time use \a DebugLocListIndex, while those with a 60*9880d681SAndroid Build Coastguard Worker /// single instruction use \a MInsn and (optionally) a single entry of \a Expr. 61*9880d681SAndroid Build Coastguard Worker /// 62*9880d681SAndroid Build Coastguard Worker /// Variables that have been optimized out use none of these fields. 63*9880d681SAndroid Build Coastguard Worker class DbgVariable { 64*9880d681SAndroid Build Coastguard Worker const DILocalVariable *Var; /// Variable Descriptor. 65*9880d681SAndroid Build Coastguard Worker const DILocation *IA; /// Inlined at location. 66*9880d681SAndroid Build Coastguard Worker SmallVector<const DIExpression *, 1> Expr; /// Complex address. 67*9880d681SAndroid Build Coastguard Worker DIE *TheDIE = nullptr; /// Variable DIE. 68*9880d681SAndroid Build Coastguard Worker unsigned DebugLocListIndex = ~0u; /// Offset in DebugLocs. 69*9880d681SAndroid Build Coastguard Worker const MachineInstr *MInsn = nullptr; /// DBG_VALUE instruction. 70*9880d681SAndroid Build Coastguard Worker SmallVector<int, 1> FrameIndex; /// Frame index. 71*9880d681SAndroid Build Coastguard Worker 72*9880d681SAndroid Build Coastguard Worker public: 73*9880d681SAndroid Build Coastguard Worker /// Construct a DbgVariable. 74*9880d681SAndroid Build Coastguard Worker /// 75*9880d681SAndroid Build Coastguard Worker /// Creates a variable without any DW_AT_location. Call \a initializeMMI() 76*9880d681SAndroid Build Coastguard Worker /// for MMI entries, or \a initializeDbgValue() for DBG_VALUE instructions. DbgVariable(const DILocalVariable * V,const DILocation * IA)77*9880d681SAndroid Build Coastguard Worker DbgVariable(const DILocalVariable *V, const DILocation *IA) 78*9880d681SAndroid Build Coastguard Worker : Var(V), IA(IA) {} 79*9880d681SAndroid Build Coastguard Worker 80*9880d681SAndroid Build Coastguard Worker /// Initialize from the MMI table. initializeMMI(const DIExpression * E,int FI)81*9880d681SAndroid Build Coastguard Worker void initializeMMI(const DIExpression *E, int FI) { 82*9880d681SAndroid Build Coastguard Worker assert(Expr.empty() && "Already initialized?"); 83*9880d681SAndroid Build Coastguard Worker assert(FrameIndex.empty() && "Already initialized?"); 84*9880d681SAndroid Build Coastguard Worker assert(!MInsn && "Already initialized?"); 85*9880d681SAndroid Build Coastguard Worker 86*9880d681SAndroid Build Coastguard Worker assert((!E || E->isValid()) && "Expected valid expression"); 87*9880d681SAndroid Build Coastguard Worker assert(~FI && "Expected valid index"); 88*9880d681SAndroid Build Coastguard Worker 89*9880d681SAndroid Build Coastguard Worker Expr.push_back(E); 90*9880d681SAndroid Build Coastguard Worker FrameIndex.push_back(FI); 91*9880d681SAndroid Build Coastguard Worker } 92*9880d681SAndroid Build Coastguard Worker 93*9880d681SAndroid Build Coastguard Worker /// Initialize from a DBG_VALUE instruction. initializeDbgValue(const MachineInstr * DbgValue)94*9880d681SAndroid Build Coastguard Worker void initializeDbgValue(const MachineInstr *DbgValue) { 95*9880d681SAndroid Build Coastguard Worker assert(Expr.empty() && "Already initialized?"); 96*9880d681SAndroid Build Coastguard Worker assert(FrameIndex.empty() && "Already initialized?"); 97*9880d681SAndroid Build Coastguard Worker assert(!MInsn && "Already initialized?"); 98*9880d681SAndroid Build Coastguard Worker 99*9880d681SAndroid Build Coastguard Worker assert(Var == DbgValue->getDebugVariable() && "Wrong variable"); 100*9880d681SAndroid Build Coastguard Worker assert(IA == DbgValue->getDebugLoc()->getInlinedAt() && "Wrong inlined-at"); 101*9880d681SAndroid Build Coastguard Worker 102*9880d681SAndroid Build Coastguard Worker MInsn = DbgValue; 103*9880d681SAndroid Build Coastguard Worker if (auto *E = DbgValue->getDebugExpression()) 104*9880d681SAndroid Build Coastguard Worker if (E->getNumElements()) 105*9880d681SAndroid Build Coastguard Worker Expr.push_back(E); 106*9880d681SAndroid Build Coastguard Worker } 107*9880d681SAndroid Build Coastguard Worker 108*9880d681SAndroid Build Coastguard Worker // Accessors. getVariable()109*9880d681SAndroid Build Coastguard Worker const DILocalVariable *getVariable() const { return Var; } getInlinedAt()110*9880d681SAndroid Build Coastguard Worker const DILocation *getInlinedAt() const { return IA; } getExpression()111*9880d681SAndroid Build Coastguard Worker ArrayRef<const DIExpression *> getExpression() const { return Expr; } getSingleExpression()112*9880d681SAndroid Build Coastguard Worker const DIExpression *getSingleExpression() const { 113*9880d681SAndroid Build Coastguard Worker assert(MInsn && Expr.size() <= 1); 114*9880d681SAndroid Build Coastguard Worker return Expr.size() ? Expr[0] : nullptr; 115*9880d681SAndroid Build Coastguard Worker } setDIE(DIE & D)116*9880d681SAndroid Build Coastguard Worker void setDIE(DIE &D) { TheDIE = &D; } getDIE()117*9880d681SAndroid Build Coastguard Worker DIE *getDIE() const { return TheDIE; } setDebugLocListIndex(unsigned O)118*9880d681SAndroid Build Coastguard Worker void setDebugLocListIndex(unsigned O) { DebugLocListIndex = O; } getDebugLocListIndex()119*9880d681SAndroid Build Coastguard Worker unsigned getDebugLocListIndex() const { return DebugLocListIndex; } getName()120*9880d681SAndroid Build Coastguard Worker StringRef getName() const { return Var->getName(); } getMInsn()121*9880d681SAndroid Build Coastguard Worker const MachineInstr *getMInsn() const { return MInsn; } getFrameIndex()122*9880d681SAndroid Build Coastguard Worker ArrayRef<int> getFrameIndex() const { return FrameIndex; } 123*9880d681SAndroid Build Coastguard Worker addMMIEntry(const DbgVariable & V)124*9880d681SAndroid Build Coastguard Worker void addMMIEntry(const DbgVariable &V) { 125*9880d681SAndroid Build Coastguard Worker assert(DebugLocListIndex == ~0U && !MInsn && "not an MMI entry"); 126*9880d681SAndroid Build Coastguard Worker assert(V.DebugLocListIndex == ~0U && !V.MInsn && "not an MMI entry"); 127*9880d681SAndroid Build Coastguard Worker assert(V.Var == Var && "conflicting variable"); 128*9880d681SAndroid Build Coastguard Worker assert(V.IA == IA && "conflicting inlined-at location"); 129*9880d681SAndroid Build Coastguard Worker 130*9880d681SAndroid Build Coastguard Worker assert(!FrameIndex.empty() && "Expected an MMI entry"); 131*9880d681SAndroid Build Coastguard Worker assert(!V.FrameIndex.empty() && "Expected an MMI entry"); 132*9880d681SAndroid Build Coastguard Worker assert(Expr.size() == FrameIndex.size() && "Mismatched expressions"); 133*9880d681SAndroid Build Coastguard Worker assert(V.Expr.size() == V.FrameIndex.size() && "Mismatched expressions"); 134*9880d681SAndroid Build Coastguard Worker 135*9880d681SAndroid Build Coastguard Worker Expr.append(V.Expr.begin(), V.Expr.end()); 136*9880d681SAndroid Build Coastguard Worker FrameIndex.append(V.FrameIndex.begin(), V.FrameIndex.end()); 137*9880d681SAndroid Build Coastguard Worker assert(std::all_of(Expr.begin(), Expr.end(), [](const DIExpression *E) { 138*9880d681SAndroid Build Coastguard Worker return E && E->isBitPiece(); 139*9880d681SAndroid Build Coastguard Worker }) && "conflicting locations for variable"); 140*9880d681SAndroid Build Coastguard Worker } 141*9880d681SAndroid Build Coastguard Worker 142*9880d681SAndroid Build Coastguard Worker // Translate tag to proper Dwarf tag. getTag()143*9880d681SAndroid Build Coastguard Worker dwarf::Tag getTag() const { 144*9880d681SAndroid Build Coastguard Worker // FIXME: Why don't we just infer this tag and store it all along? 145*9880d681SAndroid Build Coastguard Worker if (Var->isParameter()) 146*9880d681SAndroid Build Coastguard Worker return dwarf::DW_TAG_formal_parameter; 147*9880d681SAndroid Build Coastguard Worker 148*9880d681SAndroid Build Coastguard Worker return dwarf::DW_TAG_variable; 149*9880d681SAndroid Build Coastguard Worker } 150*9880d681SAndroid Build Coastguard Worker /// Return true if DbgVariable is artificial. isArtificial()151*9880d681SAndroid Build Coastguard Worker bool isArtificial() const { 152*9880d681SAndroid Build Coastguard Worker if (Var->isArtificial()) 153*9880d681SAndroid Build Coastguard Worker return true; 154*9880d681SAndroid Build Coastguard Worker if (getType()->isArtificial()) 155*9880d681SAndroid Build Coastguard Worker return true; 156*9880d681SAndroid Build Coastguard Worker return false; 157*9880d681SAndroid Build Coastguard Worker } 158*9880d681SAndroid Build Coastguard Worker isObjectPointer()159*9880d681SAndroid Build Coastguard Worker bool isObjectPointer() const { 160*9880d681SAndroid Build Coastguard Worker if (Var->isObjectPointer()) 161*9880d681SAndroid Build Coastguard Worker return true; 162*9880d681SAndroid Build Coastguard Worker if (getType()->isObjectPointer()) 163*9880d681SAndroid Build Coastguard Worker return true; 164*9880d681SAndroid Build Coastguard Worker return false; 165*9880d681SAndroid Build Coastguard Worker } 166*9880d681SAndroid Build Coastguard Worker hasComplexAddress()167*9880d681SAndroid Build Coastguard Worker bool hasComplexAddress() const { 168*9880d681SAndroid Build Coastguard Worker assert(MInsn && "Expected DBG_VALUE, not MMI variable"); 169*9880d681SAndroid Build Coastguard Worker assert(FrameIndex.empty() && "Expected DBG_VALUE, not MMI variable"); 170*9880d681SAndroid Build Coastguard Worker assert( 171*9880d681SAndroid Build Coastguard Worker (Expr.empty() || (Expr.size() == 1 && Expr.back()->getNumElements())) && 172*9880d681SAndroid Build Coastguard Worker "Invalid Expr for DBG_VALUE"); 173*9880d681SAndroid Build Coastguard Worker return !Expr.empty(); 174*9880d681SAndroid Build Coastguard Worker } 175*9880d681SAndroid Build Coastguard Worker bool isBlockByrefVariable() const; 176*9880d681SAndroid Build Coastguard Worker const DIType *getType() const; 177*9880d681SAndroid Build Coastguard Worker 178*9880d681SAndroid Build Coastguard Worker private: resolve(TypedDINodeRef<T> Ref)179*9880d681SAndroid Build Coastguard Worker template <typename T> T *resolve(TypedDINodeRef<T> Ref) const { 180*9880d681SAndroid Build Coastguard Worker return Ref.resolve(); 181*9880d681SAndroid Build Coastguard Worker } 182*9880d681SAndroid Build Coastguard Worker }; 183*9880d681SAndroid Build Coastguard Worker 184*9880d681SAndroid Build Coastguard Worker 185*9880d681SAndroid Build Coastguard Worker /// Helper used to pair up a symbol and its DWARF compile unit. 186*9880d681SAndroid Build Coastguard Worker struct SymbolCU { SymbolCUSymbolCU187*9880d681SAndroid Build Coastguard Worker SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym) : Sym(Sym), CU(CU) {} 188*9880d681SAndroid Build Coastguard Worker const MCSymbol *Sym; 189*9880d681SAndroid Build Coastguard Worker DwarfCompileUnit *CU; 190*9880d681SAndroid Build Coastguard Worker }; 191*9880d681SAndroid Build Coastguard Worker 192*9880d681SAndroid Build Coastguard Worker /// Collects and handles dwarf debug information. 193*9880d681SAndroid Build Coastguard Worker class DwarfDebug : public DebugHandlerBase { 194*9880d681SAndroid Build Coastguard Worker /// All DIEValues are allocated through this allocator. 195*9880d681SAndroid Build Coastguard Worker BumpPtrAllocator DIEValueAllocator; 196*9880d681SAndroid Build Coastguard Worker 197*9880d681SAndroid Build Coastguard Worker /// Maps MDNode with its corresponding DwarfCompileUnit. 198*9880d681SAndroid Build Coastguard Worker MapVector<const MDNode *, DwarfCompileUnit *> CUMap; 199*9880d681SAndroid Build Coastguard Worker 200*9880d681SAndroid Build Coastguard Worker /// Maps a CU DIE with its corresponding DwarfCompileUnit. 201*9880d681SAndroid Build Coastguard Worker DenseMap<const DIE *, DwarfCompileUnit *> CUDieMap; 202*9880d681SAndroid Build Coastguard Worker 203*9880d681SAndroid Build Coastguard Worker /// List of all labels used in aranges generation. 204*9880d681SAndroid Build Coastguard Worker std::vector<SymbolCU> ArangeLabels; 205*9880d681SAndroid Build Coastguard Worker 206*9880d681SAndroid Build Coastguard Worker /// Size of each symbol emitted (for those symbols that have a specific size). 207*9880d681SAndroid Build Coastguard Worker DenseMap<const MCSymbol *, uint64_t> SymSize; 208*9880d681SAndroid Build Coastguard Worker 209*9880d681SAndroid Build Coastguard Worker /// Collection of abstract variables. 210*9880d681SAndroid Build Coastguard Worker DenseMap<const MDNode *, std::unique_ptr<DbgVariable>> AbstractVariables; 211*9880d681SAndroid Build Coastguard Worker SmallVector<std::unique_ptr<DbgVariable>, 64> ConcreteVariables; 212*9880d681SAndroid Build Coastguard Worker 213*9880d681SAndroid Build Coastguard Worker /// Collection of DebugLocEntry. Stored in a linked list so that DIELocLists 214*9880d681SAndroid Build Coastguard Worker /// can refer to them in spite of insertions into this list. 215*9880d681SAndroid Build Coastguard Worker DebugLocStream DebugLocs; 216*9880d681SAndroid Build Coastguard Worker 217*9880d681SAndroid Build Coastguard Worker /// This is a collection of subprogram MDNodes that are processed to 218*9880d681SAndroid Build Coastguard Worker /// create DIEs. 219*9880d681SAndroid Build Coastguard Worker SmallPtrSet<const MDNode *, 16> ProcessedSPNodes; 220*9880d681SAndroid Build Coastguard Worker 221*9880d681SAndroid Build Coastguard Worker /// If nonnull, stores the current machine function we're processing. 222*9880d681SAndroid Build Coastguard Worker const MachineFunction *CurFn; 223*9880d681SAndroid Build Coastguard Worker 224*9880d681SAndroid Build Coastguard Worker /// If nonnull, stores the CU in which the previous subprogram was contained. 225*9880d681SAndroid Build Coastguard Worker const DwarfCompileUnit *PrevCU; 226*9880d681SAndroid Build Coastguard Worker 227*9880d681SAndroid Build Coastguard Worker /// As an optimization, there is no need to emit an entry in the directory 228*9880d681SAndroid Build Coastguard Worker /// table for the same directory as DW_AT_comp_dir. 229*9880d681SAndroid Build Coastguard Worker StringRef CompilationDir; 230*9880d681SAndroid Build Coastguard Worker 231*9880d681SAndroid Build Coastguard Worker /// Holder for the file specific debug information. 232*9880d681SAndroid Build Coastguard Worker DwarfFile InfoHolder; 233*9880d681SAndroid Build Coastguard Worker 234*9880d681SAndroid Build Coastguard Worker /// Holders for the various debug information flags that we might need to 235*9880d681SAndroid Build Coastguard Worker /// have exposed. See accessor functions below for description. 236*9880d681SAndroid Build Coastguard Worker 237*9880d681SAndroid Build Coastguard Worker /// Map from MDNodes for user-defined types to their type signatures. Also 238*9880d681SAndroid Build Coastguard Worker /// used to keep track of which types we have emitted type units for. 239*9880d681SAndroid Build Coastguard Worker DenseMap<const MDNode *, uint64_t> TypeSignatures; 240*9880d681SAndroid Build Coastguard Worker 241*9880d681SAndroid Build Coastguard Worker SmallVector< 242*9880d681SAndroid Build Coastguard Worker std::pair<std::unique_ptr<DwarfTypeUnit>, const DICompositeType *>, 1> 243*9880d681SAndroid Build Coastguard Worker TypeUnitsUnderConstruction; 244*9880d681SAndroid Build Coastguard Worker 245*9880d681SAndroid Build Coastguard Worker /// Whether to emit the pubnames/pubtypes sections. 246*9880d681SAndroid Build Coastguard Worker bool HasDwarfPubSections; 247*9880d681SAndroid Build Coastguard Worker 248*9880d681SAndroid Build Coastguard Worker /// Whether to use the GNU TLS opcode (instead of the standard opcode). 249*9880d681SAndroid Build Coastguard Worker bool UseGNUTLSOpcode; 250*9880d681SAndroid Build Coastguard Worker 251*9880d681SAndroid Build Coastguard Worker /// Whether to use DWARF 2 bitfields (instead of the DWARF 4 format). 252*9880d681SAndroid Build Coastguard Worker bool UseDWARF2Bitfields; 253*9880d681SAndroid Build Coastguard Worker 254*9880d681SAndroid Build Coastguard Worker /// Whether to emit all linkage names, or just abstract subprograms. 255*9880d681SAndroid Build Coastguard Worker bool UseAllLinkageNames; 256*9880d681SAndroid Build Coastguard Worker 257*9880d681SAndroid Build Coastguard Worker /// Version of dwarf we're emitting. 258*9880d681SAndroid Build Coastguard Worker unsigned DwarfVersion; 259*9880d681SAndroid Build Coastguard Worker 260*9880d681SAndroid Build Coastguard Worker /// DWARF5 Experimental Options 261*9880d681SAndroid Build Coastguard Worker /// @{ 262*9880d681SAndroid Build Coastguard Worker bool HasDwarfAccelTables; 263*9880d681SAndroid Build Coastguard Worker bool HasAppleExtensionAttributes; 264*9880d681SAndroid Build Coastguard Worker bool HasSplitDwarf; 265*9880d681SAndroid Build Coastguard Worker 266*9880d681SAndroid Build Coastguard Worker /// Separated Dwarf Variables 267*9880d681SAndroid Build Coastguard Worker /// In general these will all be for bits that are left in the 268*9880d681SAndroid Build Coastguard Worker /// original object file, rather than things that are meant 269*9880d681SAndroid Build Coastguard Worker /// to be in the .dwo sections. 270*9880d681SAndroid Build Coastguard Worker 271*9880d681SAndroid Build Coastguard Worker /// Holder for the skeleton information. 272*9880d681SAndroid Build Coastguard Worker DwarfFile SkeletonHolder; 273*9880d681SAndroid Build Coastguard Worker 274*9880d681SAndroid Build Coastguard Worker /// Store file names for type units under fission in a line table 275*9880d681SAndroid Build Coastguard Worker /// header that will be emitted into debug_line.dwo. 276*9880d681SAndroid Build Coastguard Worker // FIXME: replace this with a map from comp_dir to table so that we 277*9880d681SAndroid Build Coastguard Worker // can emit multiple tables during LTO each of which uses directory 278*9880d681SAndroid Build Coastguard Worker // 0, referencing the comp_dir of all the type units that use it. 279*9880d681SAndroid Build Coastguard Worker MCDwarfDwoLineTable SplitTypeUnitFileTable; 280*9880d681SAndroid Build Coastguard Worker /// @} 281*9880d681SAndroid Build Coastguard Worker 282*9880d681SAndroid Build Coastguard Worker /// True iff there are multiple CUs in this module. 283*9880d681SAndroid Build Coastguard Worker bool SingleCU; 284*9880d681SAndroid Build Coastguard Worker bool IsDarwin; 285*9880d681SAndroid Build Coastguard Worker 286*9880d681SAndroid Build Coastguard Worker AddressPool AddrPool; 287*9880d681SAndroid Build Coastguard Worker 288*9880d681SAndroid Build Coastguard Worker DwarfAccelTable AccelNames; 289*9880d681SAndroid Build Coastguard Worker DwarfAccelTable AccelObjC; 290*9880d681SAndroid Build Coastguard Worker DwarfAccelTable AccelNamespace; 291*9880d681SAndroid Build Coastguard Worker DwarfAccelTable AccelTypes; 292*9880d681SAndroid Build Coastguard Worker 293*9880d681SAndroid Build Coastguard Worker // Identify a debugger for "tuning" the debug info. 294*9880d681SAndroid Build Coastguard Worker DebuggerKind DebuggerTuning; 295*9880d681SAndroid Build Coastguard Worker 296*9880d681SAndroid Build Coastguard Worker /// \defgroup DebuggerTuning Predicates to tune DWARF for a given debugger. 297*9880d681SAndroid Build Coastguard Worker /// 298*9880d681SAndroid Build Coastguard Worker /// Returns whether we are "tuning" for a given debugger. 299*9880d681SAndroid Build Coastguard Worker /// Should be used only within the constructor, to set feature flags. 300*9880d681SAndroid Build Coastguard Worker /// @{ tuneForGDB()301*9880d681SAndroid Build Coastguard Worker bool tuneForGDB() const { return DebuggerTuning == DebuggerKind::GDB; } tuneForLLDB()302*9880d681SAndroid Build Coastguard Worker bool tuneForLLDB() const { return DebuggerTuning == DebuggerKind::LLDB; } tuneForSCE()303*9880d681SAndroid Build Coastguard Worker bool tuneForSCE() const { return DebuggerTuning == DebuggerKind::SCE; } 304*9880d681SAndroid Build Coastguard Worker /// @} 305*9880d681SAndroid Build Coastguard Worker 306*9880d681SAndroid Build Coastguard Worker MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &); 307*9880d681SAndroid Build Coastguard Worker getUnits()308*9880d681SAndroid Build Coastguard Worker const SmallVectorImpl<std::unique_ptr<DwarfCompileUnit>> &getUnits() { 309*9880d681SAndroid Build Coastguard Worker return InfoHolder.getUnits(); 310*9880d681SAndroid Build Coastguard Worker } 311*9880d681SAndroid Build Coastguard Worker 312*9880d681SAndroid Build Coastguard Worker typedef DbgValueHistoryMap::InlinedVariable InlinedVariable; 313*9880d681SAndroid Build Coastguard Worker 314*9880d681SAndroid Build Coastguard Worker /// Find abstract variable associated with Var. 315*9880d681SAndroid Build Coastguard Worker DbgVariable *getExistingAbstractVariable(InlinedVariable IV, 316*9880d681SAndroid Build Coastguard Worker const DILocalVariable *&Cleansed); 317*9880d681SAndroid Build Coastguard Worker DbgVariable *getExistingAbstractVariable(InlinedVariable IV); 318*9880d681SAndroid Build Coastguard Worker void createAbstractVariable(const DILocalVariable *DV, LexicalScope *Scope); 319*9880d681SAndroid Build Coastguard Worker void ensureAbstractVariableIsCreated(InlinedVariable Var, 320*9880d681SAndroid Build Coastguard Worker const MDNode *Scope); 321*9880d681SAndroid Build Coastguard Worker void ensureAbstractVariableIsCreatedIfScoped(InlinedVariable Var, 322*9880d681SAndroid Build Coastguard Worker const MDNode *Scope); 323*9880d681SAndroid Build Coastguard Worker 324*9880d681SAndroid Build Coastguard Worker DbgVariable *createConcreteVariable(LexicalScope &Scope, InlinedVariable IV); 325*9880d681SAndroid Build Coastguard Worker 326*9880d681SAndroid Build Coastguard Worker /// Construct a DIE for this abstract scope. 327*9880d681SAndroid Build Coastguard Worker void constructAbstractSubprogramScopeDIE(LexicalScope *Scope); 328*9880d681SAndroid Build Coastguard Worker 329*9880d681SAndroid Build Coastguard Worker void finishVariableDefinitions(); 330*9880d681SAndroid Build Coastguard Worker 331*9880d681SAndroid Build Coastguard Worker void finishSubprogramDefinitions(); 332*9880d681SAndroid Build Coastguard Worker 333*9880d681SAndroid Build Coastguard Worker /// Finish off debug information after all functions have been 334*9880d681SAndroid Build Coastguard Worker /// processed. 335*9880d681SAndroid Build Coastguard Worker void finalizeModuleInfo(); 336*9880d681SAndroid Build Coastguard Worker 337*9880d681SAndroid Build Coastguard Worker /// Emit the debug info section. 338*9880d681SAndroid Build Coastguard Worker void emitDebugInfo(); 339*9880d681SAndroid Build Coastguard Worker 340*9880d681SAndroid Build Coastguard Worker /// Emit the abbreviation section. 341*9880d681SAndroid Build Coastguard Worker void emitAbbreviations(); 342*9880d681SAndroid Build Coastguard Worker 343*9880d681SAndroid Build Coastguard Worker /// Emit a specified accelerator table. 344*9880d681SAndroid Build Coastguard Worker void emitAccel(DwarfAccelTable &Accel, MCSection *Section, 345*9880d681SAndroid Build Coastguard Worker StringRef TableName); 346*9880d681SAndroid Build Coastguard Worker 347*9880d681SAndroid Build Coastguard Worker /// Emit visible names into a hashed accelerator table section. 348*9880d681SAndroid Build Coastguard Worker void emitAccelNames(); 349*9880d681SAndroid Build Coastguard Worker 350*9880d681SAndroid Build Coastguard Worker /// Emit objective C classes and categories into a hashed 351*9880d681SAndroid Build Coastguard Worker /// accelerator table section. 352*9880d681SAndroid Build Coastguard Worker void emitAccelObjC(); 353*9880d681SAndroid Build Coastguard Worker 354*9880d681SAndroid Build Coastguard Worker /// Emit namespace dies into a hashed accelerator table. 355*9880d681SAndroid Build Coastguard Worker void emitAccelNamespaces(); 356*9880d681SAndroid Build Coastguard Worker 357*9880d681SAndroid Build Coastguard Worker /// Emit type dies into a hashed accelerator table. 358*9880d681SAndroid Build Coastguard Worker void emitAccelTypes(); 359*9880d681SAndroid Build Coastguard Worker 360*9880d681SAndroid Build Coastguard Worker /// Emit visible names into a debug pubnames section. 361*9880d681SAndroid Build Coastguard Worker /// \param GnuStyle determines whether or not we want to emit 362*9880d681SAndroid Build Coastguard Worker /// additional information into the table ala newer gcc for gdb 363*9880d681SAndroid Build Coastguard Worker /// index. 364*9880d681SAndroid Build Coastguard Worker void emitDebugPubNames(bool GnuStyle = false); 365*9880d681SAndroid Build Coastguard Worker 366*9880d681SAndroid Build Coastguard Worker /// Emit visible types into a debug pubtypes section. 367*9880d681SAndroid Build Coastguard Worker /// \param GnuStyle determines whether or not we want to emit 368*9880d681SAndroid Build Coastguard Worker /// additional information into the table ala newer gcc for gdb 369*9880d681SAndroid Build Coastguard Worker /// index. 370*9880d681SAndroid Build Coastguard Worker void emitDebugPubTypes(bool GnuStyle = false); 371*9880d681SAndroid Build Coastguard Worker 372*9880d681SAndroid Build Coastguard Worker void emitDebugPubSection( 373*9880d681SAndroid Build Coastguard Worker bool GnuStyle, MCSection *PSec, StringRef Name, 374*9880d681SAndroid Build Coastguard Worker const StringMap<const DIE *> &(DwarfCompileUnit::*Accessor)() const); 375*9880d681SAndroid Build Coastguard Worker 376*9880d681SAndroid Build Coastguard Worker /// Emit null-terminated strings into a debug str section. 377*9880d681SAndroid Build Coastguard Worker void emitDebugStr(); 378*9880d681SAndroid Build Coastguard Worker 379*9880d681SAndroid Build Coastguard Worker /// Emit variable locations into a debug loc section. 380*9880d681SAndroid Build Coastguard Worker void emitDebugLoc(); 381*9880d681SAndroid Build Coastguard Worker 382*9880d681SAndroid Build Coastguard Worker /// Emit variable locations into a debug loc dwo section. 383*9880d681SAndroid Build Coastguard Worker void emitDebugLocDWO(); 384*9880d681SAndroid Build Coastguard Worker 385*9880d681SAndroid Build Coastguard Worker /// Emit address ranges into a debug aranges section. 386*9880d681SAndroid Build Coastguard Worker void emitDebugARanges(); 387*9880d681SAndroid Build Coastguard Worker 388*9880d681SAndroid Build Coastguard Worker /// Emit address ranges into a debug ranges section. 389*9880d681SAndroid Build Coastguard Worker void emitDebugRanges(); 390*9880d681SAndroid Build Coastguard Worker 391*9880d681SAndroid Build Coastguard Worker /// Emit macros into a debug macinfo section. 392*9880d681SAndroid Build Coastguard Worker void emitDebugMacinfo(); 393*9880d681SAndroid Build Coastguard Worker void emitMacro(DIMacro &M); 394*9880d681SAndroid Build Coastguard Worker void emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U); 395*9880d681SAndroid Build Coastguard Worker void handleMacroNodes(DIMacroNodeArray Nodes, DwarfCompileUnit &U); 396*9880d681SAndroid Build Coastguard Worker 397*9880d681SAndroid Build Coastguard Worker /// DWARF 5 Experimental Split Dwarf Emitters 398*9880d681SAndroid Build Coastguard Worker 399*9880d681SAndroid Build Coastguard Worker /// Initialize common features of skeleton units. 400*9880d681SAndroid Build Coastguard Worker void initSkeletonUnit(const DwarfUnit &U, DIE &Die, 401*9880d681SAndroid Build Coastguard Worker std::unique_ptr<DwarfCompileUnit> NewU); 402*9880d681SAndroid Build Coastguard Worker 403*9880d681SAndroid Build Coastguard Worker /// Construct the split debug info compile unit for the debug info 404*9880d681SAndroid Build Coastguard Worker /// section. 405*9880d681SAndroid Build Coastguard Worker DwarfCompileUnit &constructSkeletonCU(const DwarfCompileUnit &CU); 406*9880d681SAndroid Build Coastguard Worker 407*9880d681SAndroid Build Coastguard Worker /// Emit the debug info dwo section. 408*9880d681SAndroid Build Coastguard Worker void emitDebugInfoDWO(); 409*9880d681SAndroid Build Coastguard Worker 410*9880d681SAndroid Build Coastguard Worker /// Emit the debug abbrev dwo section. 411*9880d681SAndroid Build Coastguard Worker void emitDebugAbbrevDWO(); 412*9880d681SAndroid Build Coastguard Worker 413*9880d681SAndroid Build Coastguard Worker /// Emit the debug line dwo section. 414*9880d681SAndroid Build Coastguard Worker void emitDebugLineDWO(); 415*9880d681SAndroid Build Coastguard Worker 416*9880d681SAndroid Build Coastguard Worker /// Emit the debug str dwo section. 417*9880d681SAndroid Build Coastguard Worker void emitDebugStrDWO(); 418*9880d681SAndroid Build Coastguard Worker 419*9880d681SAndroid Build Coastguard Worker /// Flags to let the linker know we have emitted new style pubnames. Only 420*9880d681SAndroid Build Coastguard Worker /// emit it here if we don't have a skeleton CU for split dwarf. 421*9880d681SAndroid Build Coastguard Worker void addGnuPubAttributes(DwarfUnit &U, DIE &D) const; 422*9880d681SAndroid Build Coastguard Worker 423*9880d681SAndroid Build Coastguard Worker /// Create new DwarfCompileUnit for the given metadata node with tag 424*9880d681SAndroid Build Coastguard Worker /// DW_TAG_compile_unit. 425*9880d681SAndroid Build Coastguard Worker DwarfCompileUnit &constructDwarfCompileUnit(const DICompileUnit *DIUnit); 426*9880d681SAndroid Build Coastguard Worker 427*9880d681SAndroid Build Coastguard Worker /// Construct imported_module or imported_declaration DIE. 428*9880d681SAndroid Build Coastguard Worker void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU, 429*9880d681SAndroid Build Coastguard Worker const DIImportedEntity *N); 430*9880d681SAndroid Build Coastguard Worker 431*9880d681SAndroid Build Coastguard Worker /// Register a source line with debug info. Returns the unique 432*9880d681SAndroid Build Coastguard Worker /// label that was emitted and which provides correspondence to the 433*9880d681SAndroid Build Coastguard Worker /// source line list. 434*9880d681SAndroid Build Coastguard Worker void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope, 435*9880d681SAndroid Build Coastguard Worker unsigned Flags); 436*9880d681SAndroid Build Coastguard Worker 437*9880d681SAndroid Build Coastguard Worker /// Populate LexicalScope entries with variables' info. 438*9880d681SAndroid Build Coastguard Worker void collectVariableInfo(DwarfCompileUnit &TheCU, const DISubprogram *SP, 439*9880d681SAndroid Build Coastguard Worker DenseSet<InlinedVariable> &ProcessedVars); 440*9880d681SAndroid Build Coastguard Worker 441*9880d681SAndroid Build Coastguard Worker /// Build the location list for all DBG_VALUEs in the 442*9880d681SAndroid Build Coastguard Worker /// function that describe the same variable. 443*9880d681SAndroid Build Coastguard Worker void buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, 444*9880d681SAndroid Build Coastguard Worker const DbgValueHistoryMap::InstrRanges &Ranges); 445*9880d681SAndroid Build Coastguard Worker 446*9880d681SAndroid Build Coastguard Worker /// Collect variable information from the side table maintained 447*9880d681SAndroid Build Coastguard Worker /// by MMI. 448*9880d681SAndroid Build Coastguard Worker void collectVariableInfoFromMMITable(DenseSet<InlinedVariable> &P); 449*9880d681SAndroid Build Coastguard Worker 450*9880d681SAndroid Build Coastguard Worker public: 451*9880d681SAndroid Build Coastguard Worker //===--------------------------------------------------------------------===// 452*9880d681SAndroid Build Coastguard Worker // Main entry points. 453*9880d681SAndroid Build Coastguard Worker // 454*9880d681SAndroid Build Coastguard Worker DwarfDebug(AsmPrinter *A, Module *M); 455*9880d681SAndroid Build Coastguard Worker 456*9880d681SAndroid Build Coastguard Worker ~DwarfDebug() override; 457*9880d681SAndroid Build Coastguard Worker 458*9880d681SAndroid Build Coastguard Worker /// Emit all Dwarf sections that should come prior to the 459*9880d681SAndroid Build Coastguard Worker /// content. 460*9880d681SAndroid Build Coastguard Worker void beginModule(); 461*9880d681SAndroid Build Coastguard Worker 462*9880d681SAndroid Build Coastguard Worker /// Emit all Dwarf sections that should come after the content. 463*9880d681SAndroid Build Coastguard Worker void endModule() override; 464*9880d681SAndroid Build Coastguard Worker 465*9880d681SAndroid Build Coastguard Worker /// Gather pre-function debug information. 466*9880d681SAndroid Build Coastguard Worker void beginFunction(const MachineFunction *MF) override; 467*9880d681SAndroid Build Coastguard Worker 468*9880d681SAndroid Build Coastguard Worker /// Gather and emit post-function debug information. 469*9880d681SAndroid Build Coastguard Worker void endFunction(const MachineFunction *MF) override; 470*9880d681SAndroid Build Coastguard Worker 471*9880d681SAndroid Build Coastguard Worker /// Process beginning of an instruction. 472*9880d681SAndroid Build Coastguard Worker void beginInstruction(const MachineInstr *MI) override; 473*9880d681SAndroid Build Coastguard Worker 474*9880d681SAndroid Build Coastguard Worker /// Perform an MD5 checksum of \p Identifier and return the lower 64 bits. 475*9880d681SAndroid Build Coastguard Worker static uint64_t makeTypeSignature(StringRef Identifier); 476*9880d681SAndroid Build Coastguard Worker 477*9880d681SAndroid Build Coastguard Worker /// Add a DIE to the set of types that we're going to pull into 478*9880d681SAndroid Build Coastguard Worker /// type units. 479*9880d681SAndroid Build Coastguard Worker void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier, 480*9880d681SAndroid Build Coastguard Worker DIE &Die, const DICompositeType *CTy); 481*9880d681SAndroid Build Coastguard Worker 482*9880d681SAndroid Build Coastguard Worker /// Add a label so that arange data can be generated for it. addArangeLabel(SymbolCU SCU)483*9880d681SAndroid Build Coastguard Worker void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); } 484*9880d681SAndroid Build Coastguard Worker 485*9880d681SAndroid Build Coastguard Worker /// For symbols that have a size designated (e.g. common symbols), 486*9880d681SAndroid Build Coastguard Worker /// this tracks that size. setSymbolSize(const MCSymbol * Sym,uint64_t Size)487*9880d681SAndroid Build Coastguard Worker void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override { 488*9880d681SAndroid Build Coastguard Worker SymSize[Sym] = Size; 489*9880d681SAndroid Build Coastguard Worker } 490*9880d681SAndroid Build Coastguard Worker 491*9880d681SAndroid Build Coastguard Worker /// Returns whether we should emit all DW_AT_[MIPS_]linkage_name. 492*9880d681SAndroid Build Coastguard Worker /// If not, we still might emit certain cases. useAllLinkageNames()493*9880d681SAndroid Build Coastguard Worker bool useAllLinkageNames() const { return UseAllLinkageNames; } 494*9880d681SAndroid Build Coastguard Worker 495*9880d681SAndroid Build Coastguard Worker /// Returns whether to use DW_OP_GNU_push_tls_address, instead of the 496*9880d681SAndroid Build Coastguard Worker /// standard DW_OP_form_tls_address opcode useGNUTLSOpcode()497*9880d681SAndroid Build Coastguard Worker bool useGNUTLSOpcode() const { return UseGNUTLSOpcode; } 498*9880d681SAndroid Build Coastguard Worker 499*9880d681SAndroid Build Coastguard Worker /// Returns whether to use the DWARF2 format for bitfields instyead of the 500*9880d681SAndroid Build Coastguard Worker /// DWARF4 format. useDWARF2Bitfields()501*9880d681SAndroid Build Coastguard Worker bool useDWARF2Bitfields() const { return UseDWARF2Bitfields; } 502*9880d681SAndroid Build Coastguard Worker 503*9880d681SAndroid Build Coastguard Worker // Experimental DWARF5 features. 504*9880d681SAndroid Build Coastguard Worker 505*9880d681SAndroid Build Coastguard Worker /// Returns whether or not to emit tables that dwarf consumers can 506*9880d681SAndroid Build Coastguard Worker /// use to accelerate lookup. useDwarfAccelTables()507*9880d681SAndroid Build Coastguard Worker bool useDwarfAccelTables() const { return HasDwarfAccelTables; } 508*9880d681SAndroid Build Coastguard Worker useAppleExtensionAttributes()509*9880d681SAndroid Build Coastguard Worker bool useAppleExtensionAttributes() const { 510*9880d681SAndroid Build Coastguard Worker return HasAppleExtensionAttributes; 511*9880d681SAndroid Build Coastguard Worker } 512*9880d681SAndroid Build Coastguard Worker 513*9880d681SAndroid Build Coastguard Worker /// Returns whether or not to change the current debug info for the 514*9880d681SAndroid Build Coastguard Worker /// split dwarf proposal support. useSplitDwarf()515*9880d681SAndroid Build Coastguard Worker bool useSplitDwarf() const { return HasSplitDwarf; } 516*9880d681SAndroid Build Coastguard Worker 517*9880d681SAndroid Build Coastguard Worker /// Returns the Dwarf Version. getDwarfVersion()518*9880d681SAndroid Build Coastguard Worker unsigned getDwarfVersion() const { return DwarfVersion; } 519*9880d681SAndroid Build Coastguard Worker 520*9880d681SAndroid Build Coastguard Worker /// Returns the previous CU that was being updated getPrevCU()521*9880d681SAndroid Build Coastguard Worker const DwarfCompileUnit *getPrevCU() const { return PrevCU; } setPrevCU(const DwarfCompileUnit * PrevCU)522*9880d681SAndroid Build Coastguard Worker void setPrevCU(const DwarfCompileUnit *PrevCU) { this->PrevCU = PrevCU; } 523*9880d681SAndroid Build Coastguard Worker 524*9880d681SAndroid Build Coastguard Worker /// Returns the entries for the .debug_loc section. getDebugLocs()525*9880d681SAndroid Build Coastguard Worker const DebugLocStream &getDebugLocs() const { return DebugLocs; } 526*9880d681SAndroid Build Coastguard Worker 527*9880d681SAndroid Build Coastguard Worker /// Emit an entry for the debug loc section. This can be used to 528*9880d681SAndroid Build Coastguard Worker /// handle an entry that's going to be emitted into the debug loc section. 529*9880d681SAndroid Build Coastguard Worker void emitDebugLocEntry(ByteStreamer &Streamer, 530*9880d681SAndroid Build Coastguard Worker const DebugLocStream::Entry &Entry); 531*9880d681SAndroid Build Coastguard Worker 532*9880d681SAndroid Build Coastguard Worker /// Emit the location for a debug loc entry, including the size header. 533*9880d681SAndroid Build Coastguard Worker void emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry); 534*9880d681SAndroid Build Coastguard Worker 535*9880d681SAndroid Build Coastguard Worker /// Find the MDNode for the given reference. resolve(TypedDINodeRef<T> Ref)536*9880d681SAndroid Build Coastguard Worker template <typename T> T *resolve(TypedDINodeRef<T> Ref) const { 537*9880d681SAndroid Build Coastguard Worker return Ref.resolve(); 538*9880d681SAndroid Build Coastguard Worker } 539*9880d681SAndroid Build Coastguard Worker 540*9880d681SAndroid Build Coastguard Worker /// Find the DwarfCompileUnit for the given CU Die. lookupUnit(const DIE * CU)541*9880d681SAndroid Build Coastguard Worker DwarfCompileUnit *lookupUnit(const DIE *CU) const { 542*9880d681SAndroid Build Coastguard Worker return CUDieMap.lookup(CU); 543*9880d681SAndroid Build Coastguard Worker } 544*9880d681SAndroid Build Coastguard Worker 545*9880d681SAndroid Build Coastguard Worker void addSubprogramNames(const DISubprogram *SP, DIE &Die); 546*9880d681SAndroid Build Coastguard Worker getAddressPool()547*9880d681SAndroid Build Coastguard Worker AddressPool &getAddressPool() { return AddrPool; } 548*9880d681SAndroid Build Coastguard Worker 549*9880d681SAndroid Build Coastguard Worker void addAccelName(StringRef Name, const DIE &Die); 550*9880d681SAndroid Build Coastguard Worker 551*9880d681SAndroid Build Coastguard Worker void addAccelObjC(StringRef Name, const DIE &Die); 552*9880d681SAndroid Build Coastguard Worker 553*9880d681SAndroid Build Coastguard Worker void addAccelNamespace(StringRef Name, const DIE &Die); 554*9880d681SAndroid Build Coastguard Worker 555*9880d681SAndroid Build Coastguard Worker void addAccelType(StringRef Name, const DIE &Die, char Flags); 556*9880d681SAndroid Build Coastguard Worker getCurrentFunction()557*9880d681SAndroid Build Coastguard Worker const MachineFunction *getCurrentFunction() const { return CurFn; } 558*9880d681SAndroid Build Coastguard Worker 559*9880d681SAndroid Build Coastguard Worker /// A helper function to check whether the DIE for a given Scope is 560*9880d681SAndroid Build Coastguard Worker /// going to be null. 561*9880d681SAndroid Build Coastguard Worker bool isLexicalScopeDIENull(LexicalScope *Scope); 562*9880d681SAndroid Build Coastguard Worker 563*9880d681SAndroid Build Coastguard Worker // FIXME: Sink these functions down into DwarfFile/Dwarf*Unit. 564*9880d681SAndroid Build Coastguard Worker getProcessedSPNodes()565*9880d681SAndroid Build Coastguard Worker SmallPtrSet<const MDNode *, 16> &getProcessedSPNodes() { 566*9880d681SAndroid Build Coastguard Worker return ProcessedSPNodes; 567*9880d681SAndroid Build Coastguard Worker } 568*9880d681SAndroid Build Coastguard Worker }; 569*9880d681SAndroid Build Coastguard Worker } // End of namespace llvm 570*9880d681SAndroid Build Coastguard Worker 571*9880d681SAndroid Build Coastguard Worker #endif 572