|
LLVM
10.0.0
|
#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/STLExtras.h"#include "llvm/ADT/SmallString.h"#include "llvm/ADT/SmallVector.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/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineOperand.h"#include "llvm/CodeGen/TargetFrameLowering.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/CodeView.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/TypeDumpVisitor.h"#include "llvm/DebugInfo/CodeView/TypeIndex.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/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/BinaryStreamWriter.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Endian.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 <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 |
|
static |
Definition at line 488 of file CodeViewDebug.cpp.
References B, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::COFF::DEBUG_SECTION_MAGIC, E, llvm::SmallVectorTemplateCommon< T >::end(), llvm::find(), FuncId, llvm::DebugLoc::get(), llvm::DebugLoc::getCol(), llvm::DebugLoc::getLine(), llvm::DebugHandlerBase::PrevInstLoc, and llvm::SmallVectorTemplateBase< T >::push_back().
|
static |
Definition at line 1201 of file CodeViewDebug.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorBase::empty(), and llvm::DbgVariableLocation::LoadChain.
Referenced by needsReferenceType().
|
static |
Given a DWARF calling convention, get the CodeView equivalent.
If we don't have a translation, use the NearC convention.
Definition at line 1788 of file CodeViewDebug.cpp.
References llvm::DebugHandlerBase::Asm, llvm::SmallVectorTemplateCommon< T >::back(), llvm::ArrayRef< T >::drop_front(), llvm::SmallVectorBase::empty(), getBaseType(), llvm::DISubroutineType::getCC(), llvm::MCAsmInfo::getCodePointerSize(), getFunctionOptions(), llvm::DIType::getSizeInBits(), llvm::DINode::getTag(), llvm::DISubroutineType::getTypeArray(), llvm::AsmPrinter::MAI, llvm::makeArrayRef(), llvm::None, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), llvm::DITypeRefArray::size(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 625 of file CodeViewDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), B, llvm::COFF::DEBUG_HASHES_SECTION_MAGIC, E, llvm::MCStreamer::EmitBytes(), llvm::errs(), llvm::formatv(), llvm::MCObjectFileInfo::getCOFFDebugTypesSection(), llvm::MCObjectFileInfo::getCOFFGlobalTypeHashesSection(), llvm::codeview::TypeIndex::getIndex(), llvm::AsmPrinter::getObjFileLowering(), llvm::Record::getType(), llvm_unreachable, llvm::logAllUnhandledErrors(), llvm::codeview::MaxRecordLength, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::StringRef::take_front(), and llvm::codeview::visitTypeRecord().
Referenced by getSymbolName(), and shouldAlwaysEmitCompleteClassType().
|
static |
Return ClassOptions that should be present on both the forward declaration and the defintion of a tag type.
Definition at line 1995 of file CodeViewDebug.cpp.
References llvm::codeview::ContinuationRecordBuilder::begin(), llvm::StringRef::empty(), llvm::Enumerator, llvm::DICompositeType::getBaseType(), llvm::DICompositeType::getElements(), llvm::DIScope::getFile(), getFullyQualifiedName(), llvm::DICompositeType::getIdentifier(), llvm::DIType::getLine(), llvm::DIScope::getScope(), llvm::DIType::getScope(), llvm::DINode::getTag(), llvm::APSInt::getUnsigned(), llvm::DIType::isForwardDecl(), llvm::None, and llvm::codeview::ContinuationRecordBuilder::writeMemberType().
Referenced by shouldAlwaysEmitCompleteClassType().
Definition at line 332 of file CodeViewDebug.cpp.
References getQualifiedName(), and getQualifiedNameComponents().
Referenced by getCommonClassOptions(), getFullyQualifiedName(), and shouldAlwaysEmitCompleteClassType().
Definition at line 350 of file CodeViewDebug.cpp.
References assert(), FuncId, getFullyQualifiedName(), llvm::DIScope::getName(), getPrettyScopeName(), llvm::DIScope::getScope(), I, and llvm::StringRef::split().
|
static |
Definition at line 411 of file CodeViewDebug.cpp.
References assert(), llvm::DIScope::getName(), llvm::DISubroutineType::getTypeArray(), I, isNonTrivial(), and llvm::None.
Referenced by dwarfCCToCodeView().
Definition at line 288 of file CodeViewDebug.cpp.
References llvm::StringRef::empty(), llvm::DIScope::getName(), and llvm::DINode::getTag().
Referenced by getFullyQualifiedName(), getQualifiedNameComponents(), and shouldEmitUdt().
|
static |
Definition at line 320 of file CodeViewDebug.cpp.
References llvm::reverse().
Referenced by getFullyQualifiedName(), and shouldEmitUdt().
|
static |
Definition at line 306 of file CodeViewDebug.cpp.
References llvm::dyn_cast(), getPrettyScopeName(), llvm::DIScope::getScope(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by getFullyQualifiedName(), and shouldEmitUdt().
|
static |
Definition at line 1985 of file CodeViewDebug.cpp.
References llvm::tgtok::Class, llvm::DINode::getTag(), and llvm_unreachable.
Referenced by shouldAlwaysEmitCompleteClassType().
|
static |
Definition at line 808 of file CodeViewDebug.cpp.
References llvm::MachineModuleInfo::getModule(), llvm::Module::getNamedMetadata(), llvm::DebugHandlerBase::MMI, llvm::NamedMDNode::operands(), and llvm::codeview::GlobalTypeTableBuilder::writeLeafType().
|
static |
Definition at line 2930 of file CodeViewDebug.cpp.
References assert(), llvm::MCContext::createTempSymbol(), emitNullTerminatedSymbolName(), llvm::MachineModuleInfo::getContext(), llvm::MachineModuleInfo::getModule(), llvm::Module::getNamedMetadata(), llvm::codeview::getSymbolTypeNames(), llvm::Module::globals(), llvm::DebugHandlerBase::MMI, llvm::NamedMDNode::operands(), and shouldEmitUdt().
Referenced by llvm::object::ExportDirectoryEntryRef::ExportDirectoryEntryRef(), llvm::pdb::GSIHashStreamBuilder::finalizeBuckets(), llvm::object::COFFObjectFile::getAuxSymbol(), llvm::object::COFFObjectFile::getLoadConfig64(), llvm::object::WasmObjectFile::getNumImportedEvents(), llvm::object::XCOFFObjectFile::getSymbolNameByIndex(), and llvm::object::ImportedSymbolRef::ImportedSymbolRef().
|
static |
Definition at line 406 of file CodeViewDebug.cpp.
References llvm::DIType::getFlags().
Referenced by getFunctionOptions(), and shouldAlwaysEmitCompleteClassType().
Definition at line 2879 of file CodeViewDebug.cpp.
References llvm::DebugLoc::getLine().
Referenced by llvm::CodeViewDebug::beginInstruction().
|
static |
Definition at line 135 of file CodeViewDebug.cpp.
References llvm::codeview::ARM64, llvm::codeview::Pentium3, llvm::report_fatal_error(), llvm::codeview::Thumb, and llvm::codeview::X64.
Referenced by llvm::CodeViewDebug::CodeViewDebug().
|
static |
Definition at line 703 of file CodeViewDebug.cpp.
References C, llvm::codeview::Cobol, llvm::codeview::Cpp, D, llvm::codeview::Fortran, llvm::codeview::Java, llvm::codeview::Masm, llvm::codeview::Pascal, llvm::codeview::Swift, and llvm::IndexedInstrProf::Version.
|
static |
Definition at line 1205 of file CodeViewDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), canUseReferenceType(), E, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::DbgVariableLocation::extractFromMachineInstruction(), llvm::MCRegisterInfo::getCodeViewRegNum(), llvm::DebugHandlerBase::getLabelBeforeInsn(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineInstr::isDebugValue(), llvm::DbgVariableLocation::LoadChain, llvm::AsmPrinter::MF, llvm::SmallVectorBase::size(), and TRI.
|
static |
Definition at line 748 of file CodeViewDebug.cpp.
References C, llvm::MachineModuleInfo::getModule(), llvm::Module::getNamedMetadata(), llvm::DebugHandlerBase::MMI, N, llvm::NamedMDNode::operands(), and llvm::IndexedInstrProf::Version.
Referenced by getOSTypeFromMCVM(), getOSTypeFromPlatform(), and isSDKVersionToken().
|
static |
Definition at line 2199 of file CodeViewDebug.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::ClassInfo::MemberInfo::BaseOffset, llvm::codeview::DefRangeRegisterRelHeader::BasePointerOffset, llvm::codeview::ContinuationRecordBuilder::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< char >::clear(), llvm::codeview::ContainsNestedClass, llvm::dyn_cast(), emitNullTerminatedSymbolName(), llvm::StringRef::empty(), llvm::codeview::encodeFramePtrReg(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::N86::ESP, llvm::codeview::DefRangeRegisterRelHeader::Flags, llvm::LexicalScope::getChildren(), getCommonClassOptions(), llvm::DIType::getFlags(), getFullyQualifiedName(), llvm::DICompositeType::getIdentifier(), llvm::codeview::TypeIndex::getIndex(), llvm::DebugHandlerBase::getLabelAfterInsn(), llvm::DebugHandlerBase::getLabelBeforeInsn(), llvm::DIScope::getName(), llvm::DIType::getName(), llvm::DIType::getOffsetInBits(), llvm::LexicalScope::getRanges(), getRecordKind(), llvm::LexicalScope::getScopeNode(), llvm::DIType::getSizeInBits(), llvm::DINode::getTag(), I, llvm::ClassInfo::Inheritance, llvm::pdb::Int32, llvm::LexicalScope::isAbstractScope(), llvm::DIType::isBitField(), llvm::DIType::isForwardDecl(), isNonTrivial(), llvm::DIType::isStaticMember(), llvm_unreachable, llvm::codeview::DefRangeRegisterHeader::MayHaveNoName, llvm::codeview::DefRangeSubfieldRegisterHeader::MayHaveNoName, llvm::ClassInfo::Members, llvm::ClassInfo::MemberInfo::MemberTypeNode, llvm::ClassInfo::Methods, Name, llvm::codeview::Nested, llvm::ClassInfo::NestedTypes, llvm::None, llvm::codeview::DefRangeFramePointerRelHeader::Offset, llvm::codeview::DefRangeSubfieldRegisterHeader::OffsetInParent, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateBase< T >::push_back(), Reg, llvm::codeview::DefRangeRegisterHeader::Register, llvm::codeview::DefRangeSubfieldRegisterHeader::Register, llvm::codeview::DefRangeRegisterRelHeader::Register, llvm::report_fatal_error(), llvm::sort(), llvm::StringRef::startswith(), std::swap(), translateAccessFlags(), translateMethodKindFlags(), translateMethodOptionFlags(), llvm::ClassInfo::VShapeTI, and llvm::codeview::ContinuationRecordBuilder::writeMemberType().
Definition at line 1436 of file CodeViewDebug.cpp.
References assert(), llvm::dyn_cast(), llvm::StringRef::empty(), llvm::DICompositeType::getBaseType(), llvm::DebugHandlerBase::getBaseTypeSize(), llvm::DICompositeType::getElements(), llvm::DIBasicType::getEncoding(), getName(), llvm::DIType::getName(), getPrettyScopeName(), getQualifiedName(), getQualifiedNameComponents(), llvm::DIType::getScope(), llvm::codeview::TypeIndex::getSimpleKind(), llvm::codeview::TypeIndex::getSimpleMode(), llvm::DIType::getSizeInBits(), llvm::DINode::getTag(), llvm::pdb::Int32, llvm::DIType::isForwardDecl(), llvm::DIType::isObjectPointer(), llvm::codeview::TypeIndex::isSimple(), LLVM_FALLTHROUGH, llvm_unreachable, Mode, Name, llvm::None, llvm::T, and llvm::pdb::UInt32.
Referenced by getSymbolName().
|
static |
Definition at line 1943 of file CodeViewDebug.cpp.
References llvm::DINode::FlagAccessibility, and llvm_unreachable.
Referenced by shouldAlwaysEmitCompleteClassType().
|
static |
Definition at line 1965 of file CodeViewDebug.cpp.
References llvm_unreachable, and llvm::Reloc::Static.
Referenced by shouldAlwaysEmitCompleteClassType().
|
static |
Definition at line 1956 of file CodeViewDebug.cpp.
References llvm::None.
Referenced by shouldAlwaysEmitCompleteClassType().
|
static |
Definition at line 1735 of file CodeViewDebug.cpp.
References assert(), llvm::DINode::FlagPtrToMemberRep, llvm::DIType::getFlags(), llvm::DIType::getSizeInBits(), llvm::DINode::getTag(), llvm_unreachable, and llvm::Unknown.
1.8.13