14#define DEBUG_TYPE "dx-debug-info"
31 M.getContext(), Lang,
CU->getFile(),
CU->getProducer(),
32 CU->isOptimized(),
CU->getFlags(),
CU->getRuntimeVersion(),
33 CU->getSplitDebugFilename(),
CU->getEmissionKind(),
34 CU->getEnumTypes(),
CU->getRetainedTypes(),
CU->getGlobalVariables(),
35 CU->getImportedEntities(),
CU->getMacros(),
CU->getDWOId(),
36 CU->getSplitDebugInlining(),
CU->getDebugInfoForProfiling(),
37 CU->getNameTableKind(),
CU->getRangesBaseAddress(),
CU->getSysRoot(),
43 std::vector<std::pair<const DICompileUnit *, const Metadata *>> CUSubprograms;
54 CUSubprograms.push_back(
55 {SP->getUnit(),
static_cast<const Metadata *
>(SP)});
59 CUSubprograms.begin(), CUSubprograms.end(), [](
auto &&
A,
auto &&
B) {
60 return std::less<const DICompileUnit *>()(A.first, B.first);
62 for (
auto It = CUSubprograms.begin(), End = CUSubprograms.end(); It != End;) {
69 }
while (++It != End && It->first ==
CU);
70 const auto *SubprogramsMD =
MDTuple::get(M.getContext(), Subprograms);
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file contains constants used for implementing Dwarf debug support.
Module.h This file contains the declarations for the Module class.
Wrapper structure that holds a language name and its version.
uint32_t getVersion() const
Returns language version. Only valid for versioned language names.
bool hasVersionedName() const
uint16_t getName() const
Returns a versioned or unversioned language name.
Subprogram description. Uses SubclassData1.
Utility to find all debug info in a module.
LLVM_ABI void processModule(const Module &M)
Process entire module and collect debug info anchors.
iterator_range< subprogram_iterator > subprograms() const
iterator_range< compile_unit_iterator > compile_units() const
ValueT lookup_or(const_arg_type_t< KeyT > Val, U &&Default) const
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
A Module instance is used to store all the information related to an LLVM module.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
MDMap MDExtra
Enumerate extra metadata when Key is encountered in ValueEnumerator.
MDMap MDReplace
Completely replace one metadata with another in ValueEnumerator.
std::optional< SourceLanguage > toDW_LANG(SourceLanguageName name, uint32_t version)
Convert a DWARF 6 pair of language name and version to a DWARF 5 DW_LANG.
DXILDebugInfoMap run(Module &M)
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.