45 if (
auto *LocalScope = dyn_cast_or_null<DILocalScope>(Scope))
65 processCompileUnit(
CU);
67 if (
auto *
SP = cast_or_null<DISubprogram>(
F.getSubprogram()))
68 processSubprogram(
SP);
73 processInstruction(M,
I);
78 if (!addCompileUnit(CU))
81 if (!addGlobalVariable(DIG))
83 auto *GV = DIG->getVariable();
84 processScope(GV->getScope());
85 processType(GV->getType().resolve());
90 if (
auto *
T = dyn_cast<DIType>(RT))
93 processSubprogram(cast<DISubprogram>(RT));
95 auto *Entity =
Import->getEntity().resolve();
96 if (
auto *
T = dyn_cast<DIType>(Entity))
98 else if (
auto *
SP = dyn_cast<DISubprogram>(Entity))
99 processSubprogram(
SP);
100 else if (
auto *NS = dyn_cast<DINamespace>(Entity))
101 processScope(NS->getScope());
102 else if (
auto *M = dyn_cast<DIModule>(Entity))
103 processScope(M->getScope());
109 if (
auto *DDI = dyn_cast<DbgDeclareInst>(&I))
110 processDeclare(M, DDI);
111 else if (
auto *DVI = dyn_cast<DbgValueInst>(&I))
112 processValue(M, DVI);
115 processLocation(M, DbgLoc.get());
121 processScope(Loc->getScope());
122 processLocation(M, Loc->getInlinedAt());
125 void DebugInfoFinder::processType(
DIType *DT) {
129 if (
auto *
ST = dyn_cast<DISubroutineType>(DT)) {
131 processType(
Ref.resolve());
134 if (
auto *DCT = dyn_cast<DICompositeType>(DT)) {
135 processType(DCT->getBaseType().resolve());
137 if (
auto *
T = dyn_cast<DIType>(
D))
139 else if (
auto *
SP = dyn_cast<DISubprogram>(
D))
140 processSubprogram(
SP);
144 if (
auto *DDT = dyn_cast<DIDerivedType>(DT)) {
145 processType(DDT->getBaseType().resolve());
149 void DebugInfoFinder::processScope(
DIScope *Scope) {
152 if (
auto *Ty = dyn_cast<DIType>(Scope)) {
156 if (
auto *CU = dyn_cast<DICompileUnit>(Scope)) {
160 if (
auto *
SP = dyn_cast<DISubprogram>(Scope)) {
161 processSubprogram(
SP);
164 if (!addScope(Scope))
166 if (
auto *LB = dyn_cast<DILexicalBlockBase>(Scope)) {
167 processScope(LB->getScope());
168 }
else if (
auto *NS = dyn_cast<DINamespace>(Scope)) {
169 processScope(NS->getScope());
170 }
else if (
auto *M = dyn_cast<DIModule>(Scope)) {
171 processScope(M->getScope());
176 if (!addSubprogram(SP))
187 processCompileUnit(SP->getUnit());
188 processType(SP->getType());
189 for (
auto *Element : SP->getTemplateParams()) {
190 if (
auto *TType = dyn_cast<DITemplateTypeParameter>(Element)) {
191 processType(TType->getType().resolve());
192 }
else if (
auto *TVal = dyn_cast<DITemplateValueParameter>(Element)) {
193 processType(TVal->getType().resolve());
208 if (!NodesSeen.insert(DV).second)
210 processScope(DV->getScope());
211 processType(DV->getType().resolve());
223 if (!NodesSeen.insert(DV).second)
225 processScope(DV->getScope());
226 processType(DV->getType().resolve());
229 bool DebugInfoFinder::addType(
DIType *DT) {
233 if (!NodesSeen.insert(DT).second)
236 TYs.push_back(const_cast<DIType *>(DT));
243 if (!NodesSeen.insert(CU).second)
251 if (!NodesSeen.insert(DIG).second)
262 if (!NodesSeen.insert(SP).second)
269 bool DebugInfoFinder::addScope(
DIScope *Scope) {
276 if (!NodesSeen.insert(Scope).second)
278 Scopes.push_back(Scope);
287 return isa<DILocation>(
Op.get());
294 return !isa<DILocation>(
Op.get());
304 if (!isa<DILocation>(*
Op))
315 bool Changed =
false;
323 for (
auto II = BB.begin(), End = BB.end(); II != End;) {
325 if (isa<DbgInfoIntrinsic>(&I)) {
336 auto *TermInst = BB.getTerminator();
341 auto *NewLoopID = LoopIDsMap.
lookup(LoopID);
344 if (NewLoopID != LoopID)
352 bool Changed =
false;
362 NMD->
getName() ==
"llvm.gcov") {
371 for (
auto &GV : M.globals()) {
376 Materializer->setStripDebugInfo();
384 class DebugTypeInfoRemoval {
389 MDNode *EmptySubroutineType;
413 auto Replacement = Replacements.
find(M);
414 if (Replacement != Replacements.
end())
415 return Replacement->second;
419 MDNode *mapNode(
Metadata *
N) {
return dyn_cast_or_null<MDNode>(map(N)); }
423 void traverseAndRemap(
MDNode *N) { traverse(N); }
428 auto *FileAndScope = cast_or_null<DIFile>(map(MDS->
getFile()));
431 auto *
Type = cast_or_null<DISubroutineType>(map(MDS->getType()));
432 DITypeRef ContainingType(map(MDS->getContainingType()));
433 auto *
Unit = cast_or_null<DICompileUnit>(map(MDS->getUnit()));
434 auto Variables =
nullptr;
435 auto TemplateParams =
nullptr;
438 auto distinctMDSubprogram = [&]() {
441 FileAndScope, MDS->getLine(),
Type, MDS->getScopeLine(),
442 ContainingType, MDS->getVirtualIndex(), MDS->getThisAdjustment(),
443 MDS->getFlags(), MDS->getSPFlags(),
Unit, TemplateParams, Declaration,
448 return distinctMDSubprogram();
452 FileAndScope, MDS->getLine(),
Type, MDS->getScopeLine(), ContainingType,
453 MDS->getVirtualIndex(), MDS->getThisAdjustment(), MDS->getFlags(),
454 MDS->getSPFlags(),
Unit, TemplateParams, Declaration, Variables);
456 StringRef OldLinkageName = MDS->getLinkageName();
459 auto OrigLinkage = NewToLinkageName.
find(NewMDS);
460 if (OrigLinkage != NewToLinkageName.
end()) {
461 if (OrigLinkage->second == OldLinkageName)
467 return distinctMDSubprogram();
470 NewToLinkageName.
insert({NewMDS, MDS->getLinkageName()});
480 auto *
File = cast_or_null<DIFile>(map(CU->
getFile()));
482 MDTuple *RetainedTypes =
nullptr;
483 MDTuple *GlobalVariables =
nullptr;
484 MDTuple *ImportedEntities =
nullptr;
489 RetainedTypes, GlobalVariables, ImportedEntities, CU->
getMacros(),
496 auto *Scope = map(MLD->getScope());
497 auto *InlinedAt = map(MLD->getInlinedAt());
500 MLD->getColumn(), Scope, InlinedAt);
518 if (Replacements.
count(N))
524 if (
auto *MDSub = dyn_cast<DISubprogram>(N)) {
525 remap(MDSub->getUnit());
526 return getReplacementSubprogram(MDSub);
528 if (isa<DISubroutineType>(N))
529 return EmptySubroutineType;
530 if (
auto *CU = dyn_cast<DICompileUnit>(N))
531 return getReplacementCU(CU);
534 if (
auto *MDLB = dyn_cast<DILexicalBlockBase>(N))
536 return mapNode(MDLB->getScope());
537 if (
auto *MLD = dyn_cast<DILocation>(N))
538 return getReplacementMDLocation(MLD);
545 return getReplacementMDNode(N);
547 Replacements[
N] = doRemap(N);
556 void DebugTypeInfoRemoval::traverse(
MDNode *
N) {
557 if (!N || Replacements.count(N))
563 if (
auto *MDS = dyn_cast<DISubprogram>(Parent))
564 return Child == MDS->getRetainedNodes().get();
573 while (!ToVisit.
empty()) {
574 auto *N = ToVisit.
back();
575 if (!Opened.
insert(N).second) {
582 if (
auto *MDN = dyn_cast_or_null<MDNode>(
I))
583 if (!Opened.
count(MDN) && !Replacements.count(MDN) && !prune(N, MDN) &&
584 !isa<DICompileUnit>(MDN))
590 bool Changed =
false;
595 while (!DbgVal->use_empty())
596 cast<Instruction>(DbgVal->user_back())->eraseFromParent();
597 DbgVal->eraseFromParent();
601 RemoveUses(
"llvm.dbg.declare");
602 RemoveUses(
"llvm.dbg.value");
610 if (NMD->
getName() ==
"llvm.dbg.cu")
622 Mapper.traverseAndRemap(Node);
623 auto *NewNode = Mapper.mapNode(Node);
624 Changed |= Node != NewNode;
632 if (
auto *SP =
F.getSubprogram()) {
633 Mapper.traverseAndRemap(SP);
634 auto *NewSP = cast<DISubprogram>(Mapper.mapNode(SP));
635 Changed |= SP != NewSP;
636 F.setSubprogram(NewSP);
642 MDNode *InlinedAt = DL.getInlinedAt();
643 Scope = remap(Scope);
644 InlinedAt = remap(InlinedAt);
645 return DebugLoc::get(DL.getLine(), DL.getCol(), Scope, InlinedAt);
649 I.setDebugLoc(remapDebugLoc(
I.getDebugLoc()));
653 I.getAllMetadata(MDs);
654 for (
auto Attachment : MDs)
655 if (
auto *
T = dyn_cast_or_null<MDTuple>(Attachment.second))
656 for (
unsigned N = 0; N <
T->getNumOperands(); ++
N)
657 if (
auto *Loc = dyn_cast_or_null<DILocation>(
T->getOperand(N)))
659 T->replaceOperandWith(N, remapDebugLoc(Loc));
666 for (
auto &NMD : M.getNamedMDList()) {
683 if (
auto *Val = mdconst::dyn_extract_or_null<ConstantInt>(
685 return Val->getZExtValue();
700 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 701 case LLVMDWARFSourceLanguage##NAME: \ 703 #include "llvm/BinaryFormat/Dwarf.def" 704 #undef HANDLE_DW_LANG 710 return (DIT *)(Ref ? unwrap<MDNode>(Ref) :
nullptr);
751 unwrap(Builder)->finalize();
757 LLVMBool isOptimized,
const char *Flags,
size_t FlagsLen,
758 unsigned RuntimeVer,
const char *SplitName,
size_t SplitNameLen,
761 auto File = unwrapDI<DIFile>(FileRef);
763 return wrap(
unwrap(Builder)->createCompileUnit(
765 StringRef(Producer, ProducerLen), isOptimized,
768 static_cast<DICompileUnit::DebugEmissionKind>(Kind), DWOId,
769 SplitDebugInlining, DebugInfoForProfiling));
774 size_t FilenameLen,
const char *Directory,
775 size_t DirectoryLen) {
782 const char *
Name,
size_t NameLen,
783 const char *ConfigMacros,
size_t ConfigMacrosLen,
784 const char *IncludePath,
size_t IncludePathLen,
785 const char *ISysRoot,
size_t ISysRootLen) {
787 unwrapDI<DIScope>(ParentScope),
StringRef(Name, NameLen),
788 StringRef(ConfigMacros, ConfigMacrosLen),
795 const char *
Name,
size_t NameLen,
798 unwrapDI<DIScope>(ParentScope),
StringRef(Name, NameLen), ExportSymbols));
803 size_t NameLen,
const char *LinkageName,
size_t LinkageNameLen,
808 unwrapDI<DIScope>(Scope), {
Name, NameLen}, {LinkageName, LinkageNameLen},
809 unwrapDI<DIFile>(
File), LineNo, unwrapDI<DISubroutineType>(Ty), ScopeLine,
819 return wrap(
unwrap(Builder)->createLexicalBlock(unwrapDI<DIScope>(Scope),
820 unwrapDI<DIFile>(File),
828 unsigned Discriminator) {
829 return wrap(
unwrap(Builder)->createLexicalBlockFile(unwrapDI<DIScope>(Scope),
830 unwrapDI<DIFile>(File),
841 unwrapDI<DINamespace>(NS),
842 unwrapDI<DIFile>(File),
853 unwrapDI<DIScope>(Scope),
854 unwrapDI<DIImportedEntity>(ImportedEntity),
855 unwrapDI<DIFile>(File), Line));
865 unwrapDI<DIModule>(M),
866 unwrapDI<DIFile>(File),
876 const char *
Name,
size_t NameLen) {
877 return wrap(
unwrap(Builder)->createImportedDeclaration(
878 unwrapDI<DIScope>(Scope),
879 unwrapDI<DINode>(Decl),
880 unwrapDI<DIFile>(File), Line, {
Name, NameLen}));
892 return unwrapDI<DILocation>(Location)->getLine();
896 return unwrapDI<DILocation>(Location)->getColumn();
900 return wrap(unwrapDI<DILocation>(Location)->getScope());
908 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
910 return wrap(
unwrap(Builder)->createEnumerationType(
911 unwrapDI<DIScope>(Scope), {
Name, NameLen}, unwrapDI<DIFile>(
File),
912 LineNumber, SizeInBits, AlignInBits, Elts, unwrapDI<DIType>(ClassTy)));
920 const char *UniqueId,
size_t UniqueIdLen) {
921 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
924 unwrapDI<DIScope>(Scope), {
Name, NameLen}, unwrapDI<DIFile>(
File),
926 Elts, RunTimeLang, {UniqueId, UniqueIdLen}));
934 unsigned NumSubscripts) {
935 auto Subs =
unwrap(Builder)->getOrCreateArray({
unwrap(Subscripts),
937 return wrap(
unwrap(Builder)->createArrayType(Size, AlignInBits,
938 unwrapDI<DIType>(Ty), Subs));
945 unsigned NumSubscripts) {
946 auto Subs =
unwrap(Builder)->getOrCreateArray({
unwrap(Subscripts),
948 return wrap(
unwrap(Builder)->createVectorType(Size, AlignInBits,
949 unwrapDI<DIType>(Ty), Subs));
954 size_t NameLen, uint64_t SizeInBits,
958 SizeInBits, Encoding,
965 const char *
Name,
size_t NameLen) {
966 return wrap(
unwrap(Builder)->createPointerType(unwrapDI<DIType>(PointeeTy),
967 SizeInBits, AlignInBits,
968 AddressSpace, {
Name, NameLen}));
976 unsigned NumElements,
unsigned RunTimeLang,
LLVMMetadataRef VTableHolder,
977 const char *UniqueId,
size_t UniqueIdLen) {
978 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
980 return wrap(
unwrap(Builder)->createStructType(
981 unwrapDI<DIScope>(Scope), {
Name, NameLen}, unwrapDI<DIFile>(
File),
983 unwrapDI<DIType>(DerivedFrom), Elts, RunTimeLang,
984 unwrapDI<DIType>(VTableHolder), {UniqueId, UniqueIdLen}));
992 return wrap(
unwrap(Builder)->createMemberType(unwrapDI<DIScope>(Scope),
993 {
Name, NameLen}, unwrapDI<DIFile>(
File), LineNo, SizeInBits, AlignInBits,
1000 return wrap(
unwrap(Builder)->createUnspecifiedType({
Name, NameLen}));
1009 return wrap(
unwrap(Builder)->createStaticMemberType(
1010 unwrapDI<DIScope>(Scope), {
Name, NameLen},
1011 unwrapDI<DIFile>(
File), LineNumber, unwrapDI<DIType>(Type),
1018 const char *
Name,
size_t NameLen,
1020 uint64_t SizeInBits,
uint32_t AlignInBits,
1024 {
Name, NameLen}, unwrapDI<DIFile>(
File), LineNo,
1025 SizeInBits, AlignInBits, OffsetInBits,
1027 unwrapDI<MDNode>(PropertyNode)));
1032 const char *
Name,
size_t NameLen,
1034 const char *GetterName,
size_t GetterNameLen,
1035 const char *SetterName,
size_t SetterNameLen,
1036 unsigned PropertyAttributes,
1038 return wrap(
unwrap(Builder)->createObjCProperty(
1039 {
Name, NameLen}, unwrapDI<DIFile>(
File), LineNo,
1040 {GetterName, GetterNameLen}, {SetterName, SetterNameLen},
1041 PropertyAttributes, unwrapDI<DIType>(Ty)));
1047 return wrap(
unwrap(Builder)->createObjectPointerType(unwrapDI<DIType>(Type)));
1052 const char *
Name,
size_t NameLen,
1056 unwrapDI<DIType>(Type), {
Name, NameLen},
1057 unwrapDI<DIFile>(
File), LineNo,
1058 unwrapDI<DIScope>(Scope)));
1064 uint64_t BaseOffset,
uint32_t VBPtrOffset,
1066 return wrap(
unwrap(Builder)->createInheritance(
1067 unwrapDI<DIType>(Ty), unwrapDI<DIType>(BaseTy),
1075 unsigned RuntimeLang, uint64_t SizeInBits,
uint32_t AlignInBits,
1076 const char *UniqueIdentifier,
size_t UniqueIdentifierLen) {
1077 return wrap(
unwrap(Builder)->createForwardDecl(
1078 Tag, {
Name, NameLen}, unwrapDI<DIScope>(Scope),
1079 unwrapDI<DIFile>(File), Line, RuntimeLang, SizeInBits,
1080 AlignInBits, {UniqueIdentifier, UniqueIdentifierLen}));
1087 unsigned RuntimeLang, uint64_t SizeInBits,
uint32_t AlignInBits,
1089 size_t UniqueIdentifierLen) {
1090 return wrap(
unwrap(Builder)->createReplaceableCompositeType(
1091 Tag, {
Name, NameLen}, unwrapDI<DIScope>(Scope),
1092 unwrapDI<DIFile>(File), Line, RuntimeLang, SizeInBits,
1094 {UniqueIdentifier, UniqueIdentifierLen}));
1100 return wrap(
unwrap(Builder)->createQualifiedType(Tag,
1101 unwrapDI<DIType>(Type)));
1107 return wrap(
unwrap(Builder)->createReferenceType(Tag,
1108 unwrapDI<DIType>(Type)));
1113 return wrap(
unwrap(Builder)->createNullPtrType());
1120 uint64_t SizeInBits,
1123 return wrap(
unwrap(Builder)->createMemberPointerType(
1124 unwrapDI<DIType>(PointeeType),
1125 unwrapDI<DIType>(ClassType), AlignInBits, SizeInBits,
1132 const char *
Name,
size_t NameLen,
1134 uint64_t SizeInBits,
1135 uint64_t OffsetInBits,
1136 uint64_t StorageOffsetInBits,
1138 return wrap(
unwrap(Builder)->createBitFieldMemberType(
1139 unwrapDI<DIScope>(Scope), {
Name, NameLen},
1140 unwrapDI<DIFile>(
File), LineNumber,
1141 SizeInBits, OffsetInBits, StorageOffsetInBits,
1152 const char *UniqueIdentifier,
size_t UniqueIdentifierLen) {
1153 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
1155 return wrap(
unwrap(Builder)->createClassType(
1156 unwrapDI<DIScope>(Scope), {
Name, NameLen},
1157 unwrapDI<DIFile>(
File), LineNumber,
1158 SizeInBits, AlignInBits, OffsetInBits,
1160 Elts, unwrapDI<DIType>(VTableHolder),
1161 unwrapDI<MDNode>(TemplateParamsNode),
1162 {UniqueIdentifier, UniqueIdentifierLen}));
1168 return wrap(
unwrap(Builder)->createArtificialType(unwrapDI<DIType>(Type)));
1173 *Length = Str.
size();
1182 return unwrapDI<DIType>(DType)->getOffsetInBits();
1186 return unwrapDI<DIType>(DType)->getAlignInBits();
1190 return unwrapDI<DIType>(DType)->getLine();
1201 unwrap(Builder)->getOrCreateTypeArray({
unwrap(Types), Length}).
get());
1208 unsigned NumParameterTypes,
1210 auto Elts =
unwrap(Builder)->getOrCreateTypeArray({
unwrap(ParameterTypes),
1211 NumParameterTypes});
1212 return wrap(
unwrap(Builder)->createSubroutineType(
1217 int64_t *Addr,
size_t Length) {
1225 return wrap(
unwrap(Builder)->createConstantValueExpression(Value));
1233 return wrap(
unwrap(Builder)->createGlobalVariableExpression(
1234 unwrapDI<DIScope>(Scope), {
Name, NameLen}, {Linkage, LinkLen},
1235 unwrapDI<DIFile>(
File), LineNo, unwrapDI<DIType>(Ty), LocalToUnit,
1236 unwrap<DIExpression>(Expr), unwrapDI<MDNode>(Decl),
1237 nullptr, AlignInBits));
1252 auto *Node = unwrapDI<MDNode>(TargetMetadata);
1253 Node->replaceAllUsesWith(unwrap<Metadata>(Replacement));
1262 return wrap(
unwrap(Builder)->createTempGlobalVariableFwdDecl(
1263 unwrapDI<DIScope>(Scope), {
Name, NameLen}, {Linkage, LnkLen},
1264 unwrapDI<DIFile>(
File), LineNo, unwrapDI<DIType>(Ty), LocalToUnit,
1265 unwrapDI<MDNode>(Decl),
nullptr, AlignInBits));
1273 unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
1274 unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
1275 unwrap<Instruction>(Instr)));
1282 unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
1283 unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
1293 return wrap(
unwrap(Builder)->insertDbgValueIntrinsic(
1294 unwrap(Val), unwrap<DILocalVariable>(VarInfo),
1295 unwrap<DIExpression>(Expr), unwrap<DILocation>(DebugLoc),
1296 unwrap<Instruction>(Instr)));
1305 return wrap(
unwrap(Builder)->insertDbgValueIntrinsic(
1306 unwrap(Val), unwrap<DILocalVariable>(VarInfo),
1307 unwrap<DIExpression>(Expr), unwrap<DILocation>(DebugLoc),
1315 return wrap(
unwrap(Builder)->createAutoVariable(
1316 unwrap<DIScope>(Scope), {
Name, NameLen}, unwrap<DIFile>(
File),
1317 LineNo, unwrap<DIType>(Ty), AlwaysPreserve,
1325 return wrap(
unwrap(Builder)->createParameterVariable(
1326 unwrap<DIScope>(Scope), {
Name, NameLen}, ArgNo, unwrap<DIFile>(
File),
1327 LineNo, unwrap<DIType>(Ty), AlwaysPreserve,
1332 int64_t
Lo, int64_t Count) {
1333 return wrap(
unwrap(Builder)->getOrCreateSubrange(Lo, Count));
1340 return wrap(
unwrap(Builder)->getOrCreateArray({DataValue, Length}).
get());
1348 unwrap<Function>(Func)->setSubprogram(unwrap<DISubprogram>(SP));
1352 switch(
unwrap(Metadata)->getMetadataID()) {
1353 #define HANDLE_METADATA_LEAF(CLASS) \ 1354 case Metadata::CLASS##Kind: \ 1355 return (LLVMMetadataKind)LLVM##CLASS##MetadataKind; 1356 #include "llvm/IR/Metadata.def"
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
void processLocation(const Module &M, const DILocation *Loc)
Process debug info location.
LLVMMetadataRef LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen)
Create a DWARF unspecified type.
static void deleteTemporary(MDNode *N)
Deallocate a node created by getTemporary.
Tracking metadata reference owned by Metadata.
LLVMMetadataRef LLVMDIBuilderCreateUnionType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang, const char *UniqueId, size_t UniqueIdLen)
Create debugging information entry for a union.
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagObjectPointer and FlagArtificial set.
DILocation * get() const
Get the underlying DILocation.
LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, LLVMMetadataRef Decl, uint32_t AlignInBits)
Create a new descriptor for the specified global variable that is temporary and meant to be RAUWed...
LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
Create debugging information entry for an array.
This class represents lattice values for constants.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
unsigned getRuntimeVersion() const
A Module instance is used to store all the information related to an LLVM module. ...
LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Types, size_t Length)
Create a type array.
unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef M)
The version of debug metadata that's present in the provided Module.
static const DILocation * getMergedLocation(const DILocation *LocA, const DILocation *LocB)
When two instructions are combined into a single instruction we also need to combine the original loc...
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode)
Deallocate a temporary node.
Implements a dense probed hash-table based set.
void push_back(const T &Elt)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata)
Obtain the enumerated type of a Metadata instance.
named_metadata_iterator named_metadata_end()
static DINode::DIFlags map_from_llvmDIFlags(LLVMDIFlags Flags)
LLVMMetadataRef LLVMDIBuilderCreateFunction(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *LinkageName, size_t LinkageNameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool IsLocalToUnit, LLVMBool IsDefinition, unsigned ScopeLine, LLVMDIFlags Flags, LLVMBool IsOptimized)
Create a new descriptor for the specified subprogram.
unsigned getDebugMetadataVersionFromModule(const Module &M)
Return Debug Info Metadata Version by checking module flags.
DICompositeTypeArray getEnumTypes() const
void reset()
Clear all lists.
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported module that aliases another imported entity descriptor.
uint64_t getDWOId() const
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block)
Insert a new llvm.dbg.value intrinsic call at the end of the given basic block.
bool stripDebugInfo(Function &F)
uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType)
Get the offset of this DIType in bits.
StringRef getProducer() const
void reserve(size_type N)
bool getDebugInfoForProfiling() const
LLVMMetadataRef LLVMDIBuilderCreateMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Ty)
Create debugging information entry for a member.
op_iterator op_end() const
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding, LLVMDIFlags Flags)
Create debugging information entry for a basic type.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
void processModule(const Module &M)
Process entire module and collect debug info anchors.
static DIImportedEntity * createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, DIFile *File, unsigned Line, StringRef Name, SmallVectorImpl< TrackingMDNodeRef > &AllImportedModules)
LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang, LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen, LLVMBool isOptimized, const char *Flags, size_t FlagsLen, unsigned RuntimeVer, const char *SplitName, size_t SplitNameLen, LLVMDWARFEmissionKind Kind, unsigned DWOId, LLVMBool SplitDebugInlining, LLVMBool DebugInfoForProfiling)
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location)
Get the column number of this debug location.
LLVMMetadataRef LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, const char *GetterName, size_t GetterNameLen, const char *SetterName, size_t SetterNameLen, unsigned PropertyAttributes, LLVMMetadataRef Ty)
Create debugging information entry for Objective-C property.
LLVMDWARFEmissionKind
The amount of debug information to emit.
LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements, unsigned NumElements, LLVMMetadataRef VTableHolder, LLVMMetadataRef TemplateParamsNode, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
Create debugging information entry for a class.
StringRef getSplitDebugFilename() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
StringRef getFlags() const
unsigned LLVMDWARFTypeEncoding
An LLVM DWARF type encoding.
Attribute unwrap(LLVMAttributeRef Attr)
LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements, unsigned NumElements, LLVMMetadataRef ClassTy)
Create debugging information entry for an enumeration.
LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags)
Create a new descriptor for a function parameter variable.
LLVMContext & getContext() const
Get the global data context.
void eraseFromParent()
Drop all references and remove the node from parent module.
LLVMMetadataRef LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder, int64_t Value)
Create a new descriptor for the specified variable that does not have an address, but does have a con...
The access may reference the value stored in memory.
bool none_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly...
static StringRef getName(Value *V)
unsigned LLVMDILocationGetLine(LLVMMetadataRef Location)
Get the line number of this debug location.
bool getRangesBaseAddress() const
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata *> MDs)
bool stripNonLineTableDebugInfo(Module &M)
Downgrade the debug info in a module to contain only line table information.
Holds a subclass of DINode.
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
op_iterator op_begin() const
static Optional< DebugNameTableKind > getNameTableKind(StringRef Str)
LLVMMetadataRef LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Type)
Create debugging information entry for a bit field member.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVMMetadataRef LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, LLVMBool ExportSymbols)
Creates a new descriptor for a namespace with the specified parent scope.
LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M)
Construct a builder for a module and collect unresolved nodes attached to the module in order to reso...
LLVMMetadataRef LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a c++ style reference or rvalue reference type.
op_range operands() const
LLVMContext & getContext() const
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
bool StripDebugInfo(Module &M)
Strip debug info in the module if it exists.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVMMetadataRef LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder, LLVMMetadataRef Type)
Create a uniqued DIType* clone with FlagArtificial set.
LLVMMetadataRef LLVMDIBuilderCreatePointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace, const char *Name, size_t NameLen)
Create debugging information entry for a pointer.
LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M)
Construct a builder for a module, and do not allow for unresolved nodes attached to the module...
iterator find(const_arg_type_t< KeyT > Val)
DIMacroNodeArray getMacros() const
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata *> MDs)
Return a temporary node.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
static DISPFlags toSPFlags(bool IsLocalToUnit, bool IsDefinition, bool IsOptimized, unsigned Virtuality=SPFlagNonvirtual)
void setSubprogram(DISubprogram *SP)
Set the attached subprogram.
LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType)
Get the flags associated with this DIType.
iterator_range< iterator > functions()
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
LLVMMetadataRef LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line, unsigned Column, LLVMMetadataRef Scope, LLVMMetadataRef InlinedAt)
Creates a new DebugLocation that describes a source location.
LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMBasicBlockRef Block)
Insert a new llvm.dbg.declare intrinsic call at the end of the given basic block. ...
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef NS, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported namespace.
Import information from summary.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
Metadata * getModuleFlag(StringRef Key) const
Return the corresponding value if Key appears in module flags, otherwise return null.
LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType(LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
Create a temporary forward-declared type.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata *> MDs)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
unsigned LLVMDebugMetadataVersion()
The current debug metadata version number.
std::pair< iterator, bool > insert(const ValueT &V)
LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func)
Get the metadata of the subprogram attached to a function.
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned Col)
Create a descriptor for a lexical block with the specified parent context.
unsigned LLVMDITypeGetLine(LLVMMetadataRef DType)
Get the source line where this DIType is declared.
A pair of DIGlobalVariable and DIExpression.
DIImportedEntityArray getImportedEntities() const
LLVMDWARFSourceLanguage
Source languages known by DWARF.
void processValue(const Module &M, const DbgValueInst *DVI)
Process DbgValueInst.
LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder, int64_t Lo, int64_t Count)
Create a descriptor for a value range.
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&... Args)
LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data, size_t Count)
Create a new temporary MDNode.
static DISubprogram::DISPFlags pack_into_DISPFlags(bool IsLocalToUnit, bool IsDefinition, bool IsOptimized)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVMValueRef LLVMDIBuilderInsertDeclareBefore(LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMValueRef Instr)
Insert a new llvm.dbg.declare intrinsic call before the given instruction.
void processInstruction(const Module &M, const Instruction &I)
Process a single instruction and collect debug info anchors.
Base class for scope-like contexts.
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TargetMetadata, LLVMMetadataRef Replacement)
Replace all uses of temporary metadata.
LLVMMetadataRef LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope, const char *Name, size_t NameLen, const char *ConfigMacros, size_t ConfigMacrosLen, const char *IncludePath, size_t IncludePathLen, const char *ISysRoot, size_t ISysRootLen)
Creates a new descriptor for a module with the specified parent scope.
LLVMMetadataRef LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeType, LLVMMetadataRef ClassType, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags)
Create debugging information entry for a pointer to member.
LLVMMetadataRef LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder)
Create C++11 nullptr type.
DIT * unwrapDI(LLVMMetadataRef Ref)
Iterator for intrusive lists based on ilist_node.
LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename, size_t FilenameLen, const char *Directory, size_t DirectoryLen)
Create a file descriptor to hold debugging information for a file.
LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef M, LLVMMetadataRef File, unsigned Line)
Create a descriptor for an imported module.
StringRef getName() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr)
Insert a new llvm.dbg.value intrinsic call before the given instruction.
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits)
Create a new descriptor for a local auto variable.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void applyMergedLocation(const DILocation *LocA, const DILocation *LocB)
Merge 2 debug locations and apply it to the Instruction.
LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location)
Get the local scope associated with this debug location.
LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder, LLVMMetadataRef *Data, size_t Length)
Create an array of DI Nodes.
DISubprogram * getSubprogram() const
Get the subprogram for this scope.
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
unsigned getSourceLanguage() const
void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder)
Construct any deferred debug info descriptors.
uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType)
Get the alignment of this DIType in bits.
StringRef getName() const
DIGlobalVariableExpressionArray getGlobalVariables() const
LLVMMetadataRef LLVMDIBuilderCreateStructType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags, LLVMMetadataRef DerivedFrom, LLVMMetadataRef *Elements, unsigned NumElements, unsigned RunTimeLang, LLVMMetadataRef VTableHolder, const char *UniqueId, size_t UniqueIdLen)
Create debugging information entry for a struct.
uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType)
Get the size of this DIType in bits.
bool getSplitDebugInlining() const
static LLVMDIFlags map_to_llvmDIFlags(DINode::DIFlags Flags)
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
LLVMAttributeRef wrap(Attribute Attr)
LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, LLVMMetadataRef File, LLVMMetadataRef *ParameterTypes, unsigned NumParameterTypes, LLVMDIFlags Flags)
Create subroutine type.
LLVM_NODISCARD bool empty() const
void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder)
Deallocates the DIBuilder and everything it owns.
This represents the llvm.dbg.value instruction.
void processDeclare(const Module &M, const DbgDeclareInst *DDI)
Process DbgDeclareInst.
void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP)
Set the subprogram attached to a function.
iterator_range< debug_compile_units_iterator > debug_compile_units() const
Return an iterator for all DICompileUnits listed in this Module's llvm.dbg.cu named metadata node and...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static unsigned map_from_llvmDWARFsourcelanguage(LLVMDWARFSourceLanguage lang)
DILocalVariable * getVariable() const
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef M)
Strip debug info in the module if it exists.
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
DISPFlags
Debug info subprogram flags.
LLVMMetadataRef LLVMDIBuilderCreateStaticMemberType(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNumber, LLVMMetadataRef Type, LLVMDIFlags Flags, LLVMValueRef ConstantVal, uint32_t AlignInBits)
Create debugging information entry for a C++ static data member.
LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name, size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits)
Create a new descriptor for the specified variable.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
LLVMDIFlags
This file declares the C API endpoints for generating DWARF Debug Info.
LLVMMetadataRef LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder, LLVMMetadataRef Ty, LLVMMetadataRef BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, LLVMDIFlags Flags)
Create debugging information entry to establish inheritance relationship between two types...
DIScopeArray getRetainedTypes() const
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Discriminator)
Create a descriptor for a lexical block with a new file attached.
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static MDNode * stripDebugLocFromLoopID(MDNode *N)
LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, int64_t *Addr, size_t Length)
Create a new descriptor for the specified variable which has a complex address expression for its add...
LLVM Value Representation.
DIScopeRef getScope() const
unsigned getSizeInBits(unsigned Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI) const
Get the size in bits of Reg.
bool hasMetadata() const
Check if this has any metadata.
LLVMMetadataRef LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags, LLVMMetadataRef Ty, LLVMMetadataRef PropertyNode)
Create debugging information entry for Objective-C instance variable.
iterator_range< global_iterator > globals()
StringRef - Represent a constant reference to a string, i.e.
LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(LLVMDIBuilderRef Builder, unsigned Tag, const char *Name, size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits, const char *UniqueIdentifier, size_t UniqueIdentifierLen)
Create a permanent forward-declared type.
LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type, const char *Name, size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Scope)
Create debugging information entry for a typedef.
unsigned getNumOperands() const
Return number of MDNode operands.
const char * LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length)
Get the name of this DIType.
LLVMMetadataRef LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size, uint32_t AlignInBits, LLVMMetadataRef Ty, LLVMMetadataRef *Subscripts, unsigned NumSubscripts)
Create debugging information entry for a vector type.
This represents the llvm.dbg.declare instruction.
unsigned LLVMMetadataKind
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
LLVMMetadataRef LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Type)
Create debugging information entry for a qualified type, e.g.
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
named_metadata_iterator named_metadata_begin()
LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration(LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef Decl, LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen)
Create a descriptor for an imported function, type, or variable.
DIScopeRef getScope() const