LLVM  6.0.0svn
Classes | Functions
CodeViewDebug.cpp File Reference
#include "CodeViewDebug.h"
#include "DwarfExpression.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/LexicalScopes.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/Line.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/DebugInfo/CodeView/TypeTableCollection.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <limits>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  llvm::CodeViewDebug::TypeLoweringScope
 
struct  llvm::ClassInfo
 
struct  llvm::ClassInfo::MemberInfo
 

Functions

static StringRef getPrettyScopeName (const DIScope *Scope)
 
static const DISubprogramgetQualifiedNameComponents (const DIScope *Scope, SmallVectorImpl< StringRef > &QualifiedNameComponents)
 
static std::string getQualifiedName (ArrayRef< StringRef > QualifiedNameComponents, StringRef TypeName)
 
static std::string getFullyQualifiedName (const DIScope *Scope, StringRef Name)
 
static std::string getFullyQualifiedName (const DIScope *Ty)
 
static void addLocIfNotPresent (SmallVectorImpl< const DILocation *> &Locs, const DILocation *Loc)
 
static void emitNullTerminatedSymbolName (MCStreamer &OS, StringRef S)
 
static SourceLanguage MapDWLangToCVLang (unsigned DWLang)
 
static Version parseVersion (StringRef Name)
 
static CPUType mapArchToCVCPUType (Triple::ArchType Type)
 
static bool canUseReferenceType (const DbgVariableLocation &Loc)
 
static bool needsReferenceType (const DbgVariableLocation &Loc)
 
static bool shouldEmitUdt (const DIType *T)
 
static PointerToMemberRepresentation translatePtrToMemberRep (unsigned SizeInBytes, bool IsPMF, unsigned Flags)
 
static CallingConvention dwarfCCToCodeView (unsigned DwarfCC)
 Given a DWARF calling convention, get the CodeView equivalent. More...
 
static MemberAccess translateAccessFlags (unsigned RecordTag, unsigned Flags)
 
static MethodOptions translateMethodOptionFlags (const DISubprogram *SP)
 
static MethodKind translateMethodKindFlags (const DISubprogram *SP, bool Introduced)
 
static TypeRecordKind getRecordKind (const DICompositeType *Ty)
 
static ClassOptions getCommonClassOptions (const DICompositeType *Ty)
 Return ClassOptions that should be present on both the forward declaration and the defintion of a tag type. More...
 

Function Documentation

◆ addLocIfNotPresent()

static void addLocIfNotPresent ( SmallVectorImpl< const DILocation *> &  Locs,
const DILocation Loc 
)
static

◆ canUseReferenceType()

static bool canUseReferenceType ( const DbgVariableLocation Loc)
static

◆ dwarfCCToCodeView()

static CallingConvention dwarfCCToCodeView ( unsigned  DwarfCC)
static

◆ emitNullTerminatedSymbolName()

static void emitNullTerminatedSymbolName ( MCStreamer OS,
StringRef  S 
)
static

◆ getCommonClassOptions()

static ClassOptions getCommonClassOptions ( const DICompositeType Ty)
static

◆ getFullyQualifiedName() [1/2]

static std::string getFullyQualifiedName ( const DIScope Scope,
StringRef  Name 
)
static

◆ getFullyQualifiedName() [2/2]

static std::string getFullyQualifiedName ( const DIScope Ty)
static

◆ getPrettyScopeName()

static StringRef getPrettyScopeName ( const DIScope Scope)
static

◆ getQualifiedName()

static std::string getQualifiedName ( ArrayRef< StringRef QualifiedNameComponents,
StringRef  TypeName 
)
static

Definition at line 231 of file CodeViewDebug.cpp.

References llvm::reverse().

Referenced by getFullyQualifiedName(), and shouldEmitUdt().

◆ getQualifiedNameComponents()

static const DISubprogram* getQualifiedNameComponents ( const DIScope Scope,
SmallVectorImpl< StringRef > &  QualifiedNameComponents 
)
static

◆ getRecordKind()

static TypeRecordKind getRecordKind ( const DICompositeType Ty)
static

Definition at line 1645 of file CodeViewDebug.cpp.

References llvm::tgtok::Class, llvm::DINode::getTag(), and llvm_unreachable.

◆ mapArchToCVCPUType()

static CPUType mapArchToCVCPUType ( Triple::ArchType  Type)
static

Definition at line 617 of file CodeViewDebug.cpp.

References llvm::DebugHandlerBase::Asm, assert(), Context, llvm::MCContext::createTempSymbol(), llvm::StringRef::data(), llvm::GlobalValue::dropLLVMManglingEscape(), llvm::dyn_cast(), emitNullTerminatedSymbolName(), llvm::StringRef::empty(), llvm::WebAssembly::End, llvm::LexicalScopes::findLexicalScope(), llvm::MCRegisterInfo::getCodeViewRegNum(), llvm::MCObjectFileInfo::getCOFFDebugSymbolsSection(), llvm::MCSectionCOFF::getCOMDATSymbol(), llvm::MachineModuleInfo::getContext(), llvm::DIScope::getFile(), llvm::DIScope::getFilename(), llvm::TargetFrameLowering::getFrameIndexReference(), llvm::TargetSubtargetInfo::getFrameLowering(), getFullyQualifiedName(), llvm::AsmPrinter::getFunctionEnd(), llvm::DebugHandlerBase::getLabelAfterInsn(), llvm::DebugHandlerBase::getLabelBeforeInsn(), llvm::MachineModuleInfo::getModule(), llvm::Value::getName(), llvm::DIScope::getName(), llvm::Module::getNamedMetadata(), llvm::MDNode::getNumOperands(), llvm::AsmPrinter::getObjFileLowering(), llvm::LexicalScope::getRanges(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::DIScope::getScope(), llvm::MCSymbol::getSection(), llvm::Function::getSubprogram(), llvm::MachineFunction::getSubtarget(), llvm::AsmPrinter::getSymbol(), llvm::Module::getTargetTriple(), llvm::MachineFunction::getVariableDbgInfo(), llvm::GlobalValue::hasLocalLinkage(), I, llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::DebugHandlerBase::LScopes, MapDWLangToCVLang(), llvm::max(), llvm::AsmPrinter::MF, llvm::DebugHandlerBase::MMI, N, llvm::MDNode::operands(), llvm::NamedMDNode::operands(), parseVersion(), llvm::report_fatal_error(), llvm::TypedDINodeRef< T >::resolve(), llvm::StringRef::size(), llvm::IndexedInstrProf::Version, VI, and llvm::Triple::x86.

◆ MapDWLangToCVLang()

static SourceLanguage MapDWLangToCVLang ( unsigned  DWLang)
static

◆ needsReferenceType()

static bool needsReferenceType ( const DbgVariableLocation Loc)
static

◆ parseVersion()

static Version parseVersion ( StringRef  Name)
static

Definition at line 600 of file CodeViewDebug.cpp.

References C, N, and llvm::IndexedInstrProf::Version.

Referenced by mapArchToCVCPUType(), and llvm::object::Parser::parse().

◆ shouldEmitUdt()

static bool shouldEmitUdt ( const DIType T)
static

◆ translateAccessFlags()

static MemberAccess translateAccessFlags ( unsigned  RecordTag,
unsigned  Flags 
)
static

Definition at line 1603 of file CodeViewDebug.cpp.

References llvm::DINode::FlagAccessibility, and llvm_unreachable.

◆ translateMethodKindFlags()

static MethodKind translateMethodKindFlags ( const DISubprogram SP,
bool  Introduced 
)
static

Definition at line 1625 of file CodeViewDebug.cpp.

References llvm_unreachable, and llvm::Reloc::Static.

◆ translateMethodOptionFlags()

static MethodOptions translateMethodOptionFlags ( const DISubprogram SP)
static

Definition at line 1616 of file CodeViewDebug.cpp.

References llvm::None.

◆ translatePtrToMemberRep()

static PointerToMemberRepresentation translatePtrToMemberRep ( unsigned  SizeInBytes,
bool  IsPMF,
unsigned  Flags 
)
static