LLVM 22.0.0git
Classes | Functions
CodeViewDebug.cpp File Reference
#include "CodeViewDebug.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/TinyPtrVector.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/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h"
#include "llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h"
#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/EnumTables.h"
#include "llvm/DebugInfo/CodeView/Line.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/DebugInfo/CodeView/TypeTableCollection.h"
#include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.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/BinaryStreamWriter.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <limits>

Go to the source code of this file.

Classes

struct   llvm::ClassInfo

Functions

static std::string  formatNestedName (ArrayRef< StringRef > QualifiedNameComponents, StringRef TypeName)
static void  emitNullTerminatedSymbolName (MCStreamer &OS, StringRef S, unsigned MaxFixedRecordLength=0xF00)
static Version  parseVersion (StringRef Name)
  Given a DWARF calling convention, get the CodeView equivalent.
static MemberAccess  translateAccessFlags (unsigned RecordTag, unsigned Flags)
  Return ClassOptions that should be present on both the forward declaration and the defintion of a tag type.
static StringRef  getSymbolName (SymbolKind SymKind)
static bool  isFloatDIType (const DIType *Ty)

Function Documentation

◆  addLocIfNotPresent()

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

Definition at line 504 of file CodeViewDebug.cpp.

References llvm::is_contained(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆  canUseReferenceType()

bool canUseReferenceType ( const DbgVariableLocation & Loc )
static

Definition at line 1350 of file CodeViewDebug.cpp.

◆  dwarfCCToCodeView()

CallingConvention dwarfCCToCodeView ( unsigned DwarfCC )
static

Given a DWARF calling convention, get the CodeView equivalent.

If we don't have a translation, use the NearC convention.

Definition at line 2015 of file CodeViewDebug.cpp.

References llvm::codeview::NearC, llvm::codeview::NearFast, llvm::codeview::NearPascal, llvm::codeview::NearStdCall, llvm::codeview::NearVector, and llvm::codeview::ThisCall.

◆  emitNullTerminatedSymbolName()

void emitNullTerminatedSymbolName ( MCStreamer & OS,
unsigned MaxFixedRecordLength = 0xF00 )
static

Definition at line 731 of file CodeViewDebug.cpp.

References llvm::MCStreamer::emitBytes(), llvm::codeview::MaxRecordLength, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::StringRef::take_front().

◆  forEachJumpTableBranch()

void forEachJumpTableBranch ( const MachineFunction * MF,
bool isThumb,
const std::function< void(const MachineJumpTableInfo &, const MachineInstr &, int64_t)> & Callback )

Definition at line 3483 of file CodeViewDebug.cpp.

References assert(), E(), llvm::MachineFunction::getJumpTableInfo(), I, isThumb(), and MBB.

◆  formatNestedName()

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

Definition at line 301 of file CodeViewDebug.cpp.

References llvm::reverse().

◆  getCommonClassOptions()

ClassOptions getCommonClassOptions ( const DICompositeType * Ty )
static

Return ClassOptions that should be present on both the forward declaration and the defintion of a tag type.

Definition at line 2225 of file CodeViewDebug.cpp.

References llvm::DIScope::getScope(), llvm::codeview::HasUniqueName, llvm::isa(), llvm::codeview::Nested, llvm::codeview::None, and llvm::codeview::Scoped.

◆  getFunctionOptions()

FunctionOptions getFunctionOptions ( const DISubroutineType * Ty,
const DICompositeType * ClassTy = nullptr,
StringRef SPName = StringRef("") )
static

Definition at line 426 of file CodeViewDebug.cpp.

References llvm::codeview::Constructor, llvm::codeview::CxxReturnUdt, llvm::dyn_cast_or_null(), isNonTrivial(), and llvm::codeview::None.

◆  getPrettyScopeName()

StringRef getPrettyScopeName ( const DIScope * Scope )
static

Definition at line 262 of file CodeViewDebug.cpp.

References llvm::StringRef::empty().

◆  getRecordKind()

TypeRecordKind getRecordKind ( const DICompositeType * Ty )
static

Definition at line 2212 of file CodeViewDebug.cpp.

References llvm_unreachable.

◆  getStringIdTypeIdx()

TypeIndex getStringIdTypeIdx ( GlobalTypeTableBuilder & TypeTable,
StringRef S )
static

Definition at line 933 of file CodeViewDebug.cpp.

References llvm::codeview::GlobalTypeTableBuilder::writeLeafType().

◆  getSymbolName()

StringRef getSymbolName ( SymbolKind SymKind )
static

Definition at line 3187 of file CodeViewDebug.cpp.

References llvm::codeview::getSymbolTypeNames().

Referenced by llvm::object::ELFObjectFile< ELFT >::getSymbolFlags(), and llvm::memprof::Frame::getSymbolNameOr().

◆  isFloatDIType()

bool isFloatDIType ( const DIType * Ty )
static

Definition at line 3409 of file CodeViewDebug.cpp.

References assert(), llvm::cast(), llvm::dyn_cast(), llvm::isa(), isFloatDIType(), and T.

Referenced by isFloatDIType().

◆  isNonTrivial()

bool isNonTrivial ( const DICompositeType * DCTy )
static

Definition at line 421 of file CodeViewDebug.cpp.

References llvm::DIType::getFlags().

Referenced by getFunctionOptions().

◆  isUsableDebugLoc()

bool isUsableDebugLoc ( DebugLoc DL )
static

Definition at line 3136 of file CodeViewDebug.cpp.

References DL.

Referenced by llvm::CodeViewDebug::beginInstruction().

◆  mapArchToCVCPUType()

CPUType mapArchToCVCPUType ( Triple::ArchType Type )
static

Definition at line 114 of file CodeViewDebug.cpp.

References llvm::Triple::aarch64, llvm::codeview::ARM64, llvm::codeview::ARMNT, llvm::codeview::MIPS, llvm::Triple::mipsel, llvm::codeview::Pentium3, llvm::report_fatal_error(), llvm::Triple::thumb, llvm::codeview::Unknown, llvm::Triple::UnknownArch, llvm::codeview::X64, llvm::Triple::x86, and llvm::Triple::x86_64.

Referenced by llvm::CodeViewDebug::beginModule().

◆  MapDWARFLanguageToCVLang() [1/2]

SourceLanguage MapDWARFLanguageToCVLang ( dwarf::SourceLanguage DWLang )
static

Definition at line 605 of file CodeViewDebug.cpp.

References MapDWARFLanguageToCVLang(), and llvm::dwarf::toDW_LNAME().

◆  MapDWARFLanguageToCVLang() [2/2]

SourceLanguage MapDWARFLanguageToCVLang ( dwarf::SourceLanguageName DWLName )
static

Definition at line 573 of file CodeViewDebug.cpp.

Referenced by llvm::CodeViewDebug::beginModule(), and MapDWARFLanguageToCVLang().

◆  needsReferenceType()

bool needsReferenceType ( const DbgVariableLocation & Loc )
static

Definition at line 1354 of file CodeViewDebug.cpp.

◆  parseVersion()

Version parseVersion ( StringRef Name )
static

Definition at line 861 of file CodeViewDebug.cpp.

References llvm::CallingConv::C, and N.

Referenced by llvm::remarks::createYAMLParserFromMeta().

◆  removeTemplateArgs()

StringRef removeTemplateArgs ( StringRef Name )
static

Definition at line 369 of file CodeViewDebug.cpp.

◆  shouldAlwaysEmitCompleteClassType()

bool shouldAlwaysEmitCompleteClassType ( const DICompositeType * Ty )
static

Definition at line 2440 of file CodeViewDebug.cpp.

◆  shouldEmitUdt()

bool shouldEmitUdt ( const DIType * T )
static

Definition at line 1618 of file CodeViewDebug.cpp.

References llvm::dyn_cast(), and T.

◆  translateAccessFlags()

MemberAccess translateAccessFlags ( unsigned RecordTag,
unsigned Flags )
static

Definition at line 2170 of file CodeViewDebug.cpp.

References llvm::DINode::FlagAccessibility, llvm_unreachable, llvm::codeview::Private, llvm::codeview::Protected, and llvm::codeview::Public.

◆  translateMethodKindFlags()

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

Definition at line 2192 of file CodeViewDebug.cpp.

References llvm::codeview::IntroducingVirtual, llvm_unreachable, llvm::codeview::PureIntroducingVirtual, llvm::codeview::PureVirtual, llvm::codeview::Static, llvm::codeview::Vanilla, and llvm::codeview::Virtual.

◆  translateMethodOptionFlags()

MethodOptions translateMethodOptionFlags ( const DISubprogram * SP )
static

Definition at line 2183 of file CodeViewDebug.cpp.

References llvm::codeview::CompilerGenerated, and llvm::codeview::None.

◆  translatePtrToMemberRep()

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

Definition at line 1961 of file CodeViewDebug.cpp.

References llvm::DINode::FlagPtrToMemberRep, llvm::codeview::GeneralData, llvm::codeview::GeneralFunction, llvm_unreachable, llvm::codeview::MultipleInheritanceData, llvm::codeview::MultipleInheritanceFunction, llvm::codeview::SingleInheritanceData, llvm::codeview::SingleInheritanceFunction, llvm::codeview::Unknown, llvm::codeview::VirtualInheritanceData, and llvm::codeview::VirtualInheritanceFunction.


Generated on for LLVM by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /