LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Enumerations | Functions | Variables
DwarfDebug.cpp File Reference
#include "DwarfDebug.h"
#include "DIE.h"
#include "DIEHash.h"
#include "DwarfAccelTable.h"
#include "DwarfCompileUnit.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/DIBuilder.h"
#include "llvm/DebugInfo.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/ValueHandle.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
Include dependency graph for DwarfDebug.cpp:

Go to the source code of this file.

Classes

struct  SymbolCUSorter
 
struct  ArangeSpan
 

Namespaces

 llvm
 List of target independent CodeGen pass IDs.
 

Macros

#define DEBUG_TYPE   "dwarfdebug"
 

Enumerations

enum  DefaultOnOff
 

Functions

static unsigned getDwarfVersionFromModule (const Module *M)
 Return Dwarf Version by checking module flags. More...
 
static MCSymbolemitSectionSym (AsmPrinter *Asm, const MCSection *Section, const char *SymbolStem=0)
 
static bool isObjCClass (StringRef Name)
 
static bool hasObjCCategory (StringRef Name)
 
static void getObjCClassCategory (StringRef In, StringRef &Class, StringRef &Category)
 
static StringRef getObjCMethodName (StringRef In)
 
static bool SectionSort (const MCSection *A, const MCSection *B)
 
static void addSubprogramNames (CompileUnit *TheCU, DISubprogram SP, DIE *Die)
 
static StringRef getDIEStringAttr (DIE *Die, unsigned Attr)
 Grabs the string in whichever attribute is passed in and returns a reference to it. Returns "" if the attribute doesn't exist. More...
 
static bool isContainedInAnonNamespace (DIE *Die)
 Return true if the current DIE is contained within an anonymous namespace. More...
 
static bool shouldAddODRHash (CompileUnit *CU, DIE *Die)
 
static bool isDbgValueInDefinedReg (const MachineInstr *MI)
 
static DotDebugLocEntry getDebugLocEntry (AsmPrinter *Asm, const MCSymbol *FLabel, const MCSymbol *SLabel, const MachineInstr *MI)
 
static MDNodegetScopeNode (DebugLoc DL, const LLVMContext &Ctx)
 
static DebugLoc getFnDebugLoc (DebugLoc DL, const LLVMContext &Ctx)
 
static
dwarf::PubIndexEntryDescriptor 
computeIndexValue (CompileUnit *CU, DIE *Die)
 computeIndexValue - Compute the gdb index value for the DIE and CU. More...
 
static bool CUSort (const CompileUnit *A, const CompileUnit *B)
 

Variables

static cl::opt< boolDisableDebugInfoPrinting ("disable-debug-info-print", cl::Hidden, cl::desc("Disable debug info printing"))
 
static cl::opt< boolUnknownLocations ("use-unknown-locations", cl::Hidden, cl::desc("Make an absence of debug location information explicit."), cl::init(false))
 
static cl::opt< boolGenerateODRHash ("generate-odr-hash", cl::Hidden, cl::desc("Add an ODR hash to external type DIEs."), cl::init(false))
 
static cl::opt< boolGenerateCUHash ("generate-cu-hash", cl::Hidden, cl::desc("Add the CU hash as the dwo_id."), cl::init(false))
 
static cl::opt< boolGenerateGnuPubSections ("generate-gnu-dwarf-pub-sections", cl::Hidden, cl::desc("Generate GNU-style pubnames and pubtypes"), cl::init(false))
 
static cl::opt< DefaultOnOffDwarfAccelTables ("dwarf-accel-tables", cl::Hidden, cl::desc("Output prototype dwarf accelerator tables."), cl::values(clEnumVal(Default,"Default for platform"), clEnumVal(Enable,"Enabled"), clEnumVal(Disable,"Disabled"), clEnumValEnd), cl::init(Default))
 
static cl::opt< DefaultOnOffSplitDwarf ("split-dwarf", cl::Hidden, cl::desc("Output prototype dwarf split debug info."), cl::values(clEnumVal(Default,"Default for platform"), clEnumVal(Enable,"Enabled"), clEnumVal(Disable,"Disabled"), clEnumValEnd), cl::init(Default))
 
static cl::opt< DefaultOnOffDwarfPubSections ("generate-dwarf-pub-sections", cl::Hidden, cl::desc("Generate DWARF pubnames and pubtypes sections"), cl::values(clEnumVal(Default,"Default for platform"), clEnumVal(Enable,"Enabled"), clEnumVal(Disable,"Disabled"), clEnumValEnd), cl::init(Default))
 
static const char *const DWARFGroupName = "DWARF Emission"
 
static const char *const DbgTimerName = "DWARF Debug Writer"
 
static const unsigned InitAbbreviationsSetSize = 9
 

Macro Definition Documentation

#define DEBUG_TYPE   "dwarfdebug"

Definition at line 14 of file DwarfDebug.cpp.

Enumeration Type Documentation

Definition at line 77 of file DwarfDebug.cpp.

Function Documentation

static void addSubprogramNames ( CompileUnit TheCU,
DISubprogram  SP,
DIE Die 
)
static
static dwarf::PubIndexEntryDescriptor computeIndexValue ( CompileUnit CU,
DIE Die 
)
static
static bool CUSort ( const CompileUnit A,
const CompileUnit B 
)
static

Definition at line 2768 of file DwarfDebug.cpp.

References llvm::CompileUnit::getUniqueID().

static MCSymbol* emitSectionSym ( AsmPrinter Asm,
const MCSection Section,
const char *  SymbolStem = 0 
)
static
static DotDebugLocEntry getDebugLocEntry ( AsmPrinter Asm,
const MCSymbol FLabel,
const MCSymbol SLabel,
const MachineInstr MI 
)
static
static StringRef getDIEStringAttr ( DIE Die,
unsigned  Attr 
)
static

Grabs the string in whichever attribute is passed in and returns a reference to it. Returns "" if the attribute doesn't exist.

Definition at line 1009 of file DwarfDebug.cpp.

References llvm::DIE::findAttribute().

Referenced by isContainedInAnonNamespace(), and shouldAddODRHash().

static unsigned getDwarfVersionFromModule ( const Module M)
static

Return Dwarf Version by checking module flags.

Definition at line 174 of file DwarfDebug.cpp.

References llvm::Module::getModuleFlag().

Referenced by llvm::DwarfDebug::DwarfDebug().

static DebugLoc getFnDebugLoc ( DebugLoc  DL,
const LLVMContext Ctx 
)
static
static void getObjCClassCategory ( StringRef  In,
StringRef Class,
StringRef Category 
)
static

Definition at line 302 of file DwarfDebug.cpp.

References llvm::StringRef::find(), hasObjCCategory(), and llvm::StringRef::slice().

Referenced by addSubprogramNames().

static StringRef getObjCMethodName ( StringRef  In)
static

Definition at line 315 of file DwarfDebug.cpp.

References llvm::StringRef::find(), and llvm::StringRef::slice().

Referenced by addSubprogramNames().

static MDNode* getScopeNode ( DebugLoc  DL,
const LLVMContext Ctx 
)
static
static bool hasObjCCategory ( StringRef  Name)
static

Definition at line 296 of file DwarfDebug.cpp.

References llvm::StringRef::find(), isObjCClass(), and llvm::StringRef::npos.

Referenced by getObjCClassCategory().

static bool isContainedInAnonNamespace ( DIE Die)
static

Return true if the current DIE is contained within an anonymous namespace.

Definition at line 1019 of file DwarfDebug.cpp.

References getDIEStringAttr(), llvm::DIE::getParent(), and llvm::DIE::getTag().

Referenced by shouldAddODRHash().

static bool isDbgValueInDefinedReg ( const MachineInstr MI)
static
static bool isObjCClass ( StringRef  Name)
static

Definition at line 292 of file DwarfDebug.cpp.

References llvm::StringRef::startswith().

Referenced by addSubprogramNames(), and hasObjCCategory().

static bool SectionSort ( const MCSection A,
const MCSection B 
)
static

Definition at line 320 of file DwarfDebug.cpp.

References llvm::MCSection::getLabelBeginName().

static bool shouldAddODRHash ( CompileUnit CU,
DIE Die 
)
static

Test if the current CU language is C++ and that we have a named type that is not contained in an anonymous namespace.

Definition at line 1034 of file DwarfDebug.cpp.

References llvm::dwarf::DW_LANG_C_plus_plus, getDIEStringAttr(), llvm::CompileUnit::getLanguage(), and isContainedInAnonNamespace().

Variable Documentation

const char* const DbgTimerName = "DWARF Debug Writer"
static

Definition at line 109 of file DwarfDebug.cpp.

Referenced by llvm::DwarfDebug::DwarfDebug().

cl::opt<bool> DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden, cl::desc("Disable debug info printing"))
static
cl::opt<DefaultOnOff> DwarfAccelTables("dwarf-accel-tables", cl::Hidden, cl::desc("Output prototype dwarf accelerator tables."), cl::values(clEnumVal(Default,"Default for platform"),clEnumVal(Enable,"Enabled"),clEnumVal(Disable,"Disabled"), clEnumValEnd), cl::init(Default))
static
const char* const DWARFGroupName = "DWARF Emission"
static

Definition at line 108 of file DwarfDebug.cpp.

Referenced by llvm::DwarfDebug::DwarfDebug().

cl::opt<DefaultOnOff> DwarfPubSections("generate-dwarf-pub-sections", cl::Hidden, cl::desc("Generate DWARF pubnames and pubtypes sections"), cl::values(clEnumVal(Default,"Default for platform"),clEnumVal(Enable,"Enabled"),clEnumVal(Disable,"Disabled"), clEnumValEnd), cl::init(Default))
static
cl::opt<bool> GenerateCUHash("generate-cu-hash", cl::Hidden, cl::desc("Add the CU hash as the dwo_id."), cl::init(false))
static
cl::opt<bool> GenerateGnuPubSections("generate-gnu-dwarf-pub-sections", cl::Hidden, cl::desc("Generate GNU-style pubnames and pubtypes"), cl::init(false))
static
cl::opt<bool> GenerateODRHash("generate-odr-hash", cl::Hidden, cl::desc("Add an ODR hash to external type DIEs."), cl::init(false))
static
const unsigned InitAbbreviationsSetSize = 9
static

Definition at line 115 of file DwarfDebug.cpp.

cl::opt<DefaultOnOff> SplitDwarf("split-dwarf", cl::Hidden, cl::desc("Output prototype dwarf split debug info."), cl::values(clEnumVal(Default,"Default for platform"),clEnumVal(Enable,"Enabled"),clEnumVal(Disable,"Disabled"), clEnumValEnd), cl::init(Default))
static
cl::opt<bool> UnknownLocations("use-unknown-locations", cl::Hidden, cl::desc("Make an absence of debug location information explicit."), cl::init(false))
static