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->isLocalToUnit(),
442 MDS->isDefinition(), MDS->getScopeLine(), ContainingType,
443 MDS->getVirtuality(), MDS->getVirtualIndex(),
444 MDS->getThisAdjustment(), MDS->getFlags(), MDS->isOptimized(), Unit,
445 TemplateParams, Declaration, Variables);
449 return distinctMDSubprogram();
453 FileAndScope, MDS->getLine(),
Type, MDS->isLocalToUnit(),
454 MDS->isDefinition(), MDS->getScopeLine(), ContainingType,
455 MDS->getVirtuality(), MDS->getVirtualIndex(), MDS->getThisAdjustment(),
456 MDS->getFlags(), MDS->isOptimized(), Unit, TemplateParams, Declaration,
459 StringRef OldLinkageName = MDS->getLinkageName();
462 auto OrigLinkage = NewToLinkageName.
find(NewMDS);
463 if (OrigLinkage != NewToLinkageName.
end()) {
464 if (OrigLinkage->second == OldLinkageName)
470 return distinctMDSubprogram();
473 NewToLinkageName.
insert({NewMDS, MDS->getLinkageName()});
483 auto *
File = cast_or_null<DIFile>(map(CU->
getFile()));
485 MDTuple *RetainedTypes =
nullptr;
486 MDTuple *GlobalVariables =
nullptr;
487 MDTuple *ImportedEntities =
nullptr;
492 RetainedTypes, GlobalVariables, ImportedEntities, CU->
getMacros(),
498 auto *Scope = map(MLD->getScope());
499 auto *InlinedAt = map(MLD->getInlinedAt());
502 MLD->getColumn(), Scope, InlinedAt);
520 if (Replacements.
count(N))
526 if (
auto *MDSub = dyn_cast<DISubprogram>(N)) {
527 remap(MDSub->getUnit());
528 return getReplacementSubprogram(MDSub);
530 if (isa<DISubroutineType>(N))
531 return EmptySubroutineType;
532 if (
auto *CU = dyn_cast<DICompileUnit>(N))
533 return getReplacementCU(CU);
536 if (
auto *MDLB = dyn_cast<DILexicalBlockBase>(N))
538 return mapNode(MDLB->getScope());
539 if (
auto *MLD = dyn_cast<DILocation>(N))
540 return getReplacementMDLocation(MLD);
547 return getReplacementMDNode(N);
549 Replacements[
N] = doRemap(N);
558 void DebugTypeInfoRemoval::traverse(
MDNode *
N) {
559 if (!N || Replacements.count(N))
565 if (
auto *MDS = dyn_cast<DISubprogram>(Parent))
566 return Child == MDS->getRetainedNodes().get();
575 while (!ToVisit.
empty()) {
576 auto *N = ToVisit.
back();
577 if (!Opened.
insert(N).second) {
584 if (
auto *MDN = dyn_cast_or_null<MDNode>(
I))
585 if (!Opened.
count(MDN) && !Replacements.count(MDN) && !prune(N, MDN) &&
586 !isa<DICompileUnit>(MDN))
592 bool Changed =
false;
597 while (!DbgVal->use_empty())
598 cast<Instruction>(DbgVal->user_back())->eraseFromParent();
599 DbgVal->eraseFromParent();
603 RemoveUses(
"llvm.dbg.declare");
604 RemoveUses(
"llvm.dbg.value");
612 if (NMD->
getName() ==
"llvm.dbg.cu")
624 Mapper.traverseAndRemap(Node);
625 auto *NewNode = Mapper.mapNode(Node);
626 Changed |= Node != NewNode;
634 if (
auto *SP =
F.getSubprogram()) {
635 Mapper.traverseAndRemap(SP);
636 auto *NewSP = cast<DISubprogram>(Mapper.mapNode(SP));
637 Changed |= SP != NewSP;
638 F.setSubprogram(NewSP);
644 MDNode *InlinedAt = DL.getInlinedAt();
645 Scope = remap(Scope);
646 InlinedAt = remap(InlinedAt);
647 return DebugLoc::get(DL.getLine(), DL.getCol(), Scope, InlinedAt);
651 I.setDebugLoc(remapDebugLoc(
I.getDebugLoc()));
655 I.getAllMetadata(MDs);
656 for (
auto Attachment : MDs)
657 if (
auto *
T = dyn_cast_or_null<MDTuple>(Attachment.second))
658 for (
unsigned N = 0; N <
T->getNumOperands(); ++
N)
659 if (
auto *Loc = dyn_cast_or_null<DILocation>(
T->getOperand(N)))
661 T->replaceOperandWith(N, remapDebugLoc(Loc));
668 for (
auto &NMD : M.getNamedMDList()) {
685 if (
auto *Val = mdconst::dyn_extract_or_null<ConstantInt>(
687 return Val->getZExtValue();
703 #define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR) \ 704 case LLVMDWARFSourceLanguage##NAME: return ID; 705 #include "llvm/BinaryFormat/Dwarf.def" 706 #undef HANDLE_DW_LANG 712 return (DIT *)(Ref ? unwrap<MDNode>(Ref) :
nullptr);
748 unwrap(Builder)->finalize();
754 LLVMBool isOptimized,
const char *Flags,
size_t FlagsLen,
755 unsigned RuntimeVer,
const char *SplitName,
size_t SplitNameLen,
758 auto File = unwrapDI<DIFile>(FileRef);
760 return wrap(
unwrap(Builder)->createCompileUnit(
762 StringRef(Producer, ProducerLen), isOptimized,
765 static_cast<DICompileUnit::DebugEmissionKind>(Kind), DWOId,
766 SplitDebugInlining, DebugInfoForProfiling));
771 size_t FilenameLen,
const char *Directory,
772 size_t DirectoryLen) {
779 const char *
Name,
size_t NameLen,
780 const char *ConfigMacros,
size_t ConfigMacrosLen,
781 const char *IncludePath,
size_t IncludePathLen,
782 const char *ISysRoot,
size_t ISysRootLen) {
784 unwrapDI<DIScope>(ParentScope),
StringRef(Name, NameLen),
785 StringRef(ConfigMacros, ConfigMacrosLen),
792 const char *
Name,
size_t NameLen,
795 unwrapDI<DIScope>(ParentScope),
StringRef(Name, NameLen), ExportSymbols));
800 size_t NameLen,
const char *LinkageName,
size_t LinkageNameLen,
805 unwrapDI<DIScope>(Scope), {
Name, NameLen}, {LinkageName, LinkageNameLen},
806 unwrapDI<DIFile>(
File), LineNo, unwrapDI<DISubroutineType>(Ty),
808 IsOptimized,
nullptr,
nullptr,
nullptr));
815 return wrap(
unwrap(Builder)->createLexicalBlock(unwrapDI<DIScope>(Scope),
816 unwrapDI<DIFile>(File),
824 unsigned Discriminator) {
825 return wrap(
unwrap(Builder)->createLexicalBlockFile(unwrapDI<DIScope>(Scope),
826 unwrapDI<DIFile>(File),
837 unwrapDI<DINamespace>(NS),
838 unwrapDI<DIFile>(File),
849 unwrapDI<DIScope>(Scope),
850 unwrapDI<DIImportedEntity>(ImportedEntity),
851 unwrapDI<DIFile>(File), Line));
861 unwrapDI<DIModule>(M),
862 unwrapDI<DIFile>(File),
872 const char *
Name,
size_t NameLen) {
873 return wrap(
unwrap(Builder)->createImportedDeclaration(
874 unwrapDI<DIScope>(Scope),
875 unwrapDI<DINode>(Decl),
876 unwrapDI<DIFile>(File), Line, {
Name, NameLen}));
888 return unwrapDI<DILocation>(Location)->getLine();
892 return unwrapDI<DILocation>(Location)->getColumn();
896 return wrap(unwrapDI<DILocation>(Location)->getScope());
904 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
906 return wrap(
unwrap(Builder)->createEnumerationType(
907 unwrapDI<DIScope>(Scope), {
Name, NameLen}, unwrapDI<DIFile>(
File),
908 LineNumber, SizeInBits, AlignInBits, Elts, unwrapDI<DIType>(ClassTy)));
916 const char *UniqueId,
size_t UniqueIdLen) {
917 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
920 unwrapDI<DIScope>(Scope), {
Name, NameLen}, unwrapDI<DIFile>(
File),
922 Elts, RunTimeLang, {UniqueId, UniqueIdLen}));
930 unsigned NumSubscripts) {
931 auto Subs =
unwrap(Builder)->getOrCreateArray({
unwrap(Subscripts),
933 return wrap(
unwrap(Builder)->createArrayType(Size, AlignInBits,
934 unwrapDI<DIType>(Ty), Subs));
941 unsigned NumSubscripts) {
942 auto Subs =
unwrap(Builder)->getOrCreateArray({
unwrap(Subscripts),
944 return wrap(
unwrap(Builder)->createVectorType(Size, AlignInBits,
945 unwrapDI<DIType>(Ty), Subs));
950 size_t NameLen, uint64_t SizeInBits,
953 SizeInBits, Encoding));
959 const char *
Name,
size_t NameLen) {
960 return wrap(
unwrap(Builder)->createPointerType(unwrapDI<DIType>(PointeeTy),
961 SizeInBits, AlignInBits,
962 AddressSpace, {
Name, NameLen}));
970 unsigned NumElements,
unsigned RunTimeLang,
LLVMMetadataRef VTableHolder,
971 const char *UniqueId,
size_t UniqueIdLen) {
972 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
974 return wrap(
unwrap(Builder)->createStructType(
975 unwrapDI<DIScope>(Scope), {
Name, NameLen}, unwrapDI<DIFile>(
File),
977 unwrapDI<DIType>(DerivedFrom), Elts, RunTimeLang,
978 unwrapDI<DIType>(VTableHolder), {UniqueId, UniqueIdLen}));
986 return wrap(
unwrap(Builder)->createMemberType(unwrapDI<DIScope>(Scope),
987 {
Name, NameLen}, unwrapDI<DIFile>(
File), LineNo, SizeInBits, AlignInBits,
994 return wrap(
unwrap(Builder)->createUnspecifiedType({
Name, NameLen}));
1003 return wrap(
unwrap(Builder)->createStaticMemberType(
1004 unwrapDI<DIScope>(Scope), {
Name, NameLen},
1005 unwrapDI<DIFile>(
File), LineNumber, unwrapDI<DIType>(Type),
1012 const char *
Name,
size_t NameLen,
1014 uint64_t SizeInBits,
uint32_t AlignInBits,
1018 {
Name, NameLen}, unwrapDI<DIFile>(
File), LineNo,
1019 SizeInBits, AlignInBits, OffsetInBits,
1021 unwrapDI<MDNode>(PropertyNode)));
1026 const char *
Name,
size_t NameLen,
1028 const char *GetterName,
size_t GetterNameLen,
1029 const char *SetterName,
size_t SetterNameLen,
1030 unsigned PropertyAttributes,
1032 return wrap(
unwrap(Builder)->createObjCProperty(
1033 {
Name, NameLen}, unwrapDI<DIFile>(
File), LineNo,
1034 {GetterName, GetterNameLen}, {SetterName, SetterNameLen},
1035 PropertyAttributes, unwrapDI<DIType>(Ty)));
1041 return wrap(
unwrap(Builder)->createObjectPointerType(unwrapDI<DIType>(Type)));
1046 const char *
Name,
size_t NameLen,
1050 unwrapDI<DIType>(Type), {
Name, NameLen},
1051 unwrapDI<DIFile>(
File), LineNo,
1052 unwrapDI<DIScope>(Scope)));
1058 uint64_t BaseOffset,
uint32_t VBPtrOffset,
1060 return wrap(
unwrap(Builder)->createInheritance(
1061 unwrapDI<DIType>(Ty), unwrapDI<DIType>(BaseTy),
1069 unsigned RuntimeLang, uint64_t SizeInBits,
uint32_t AlignInBits,
1070 const char *UniqueIdentifier,
size_t UniqueIdentifierLen) {
1071 return wrap(
unwrap(Builder)->createForwardDecl(
1072 Tag, {
Name, NameLen}, unwrapDI<DIScope>(Scope),
1073 unwrapDI<DIFile>(File), Line, RuntimeLang, SizeInBits,
1074 AlignInBits, {UniqueIdentifier, UniqueIdentifierLen}));
1081 unsigned RuntimeLang, uint64_t SizeInBits,
uint32_t AlignInBits,
1083 size_t UniqueIdentifierLen) {
1084 return wrap(
unwrap(Builder)->createReplaceableCompositeType(
1085 Tag, {
Name, NameLen}, unwrapDI<DIScope>(Scope),
1086 unwrapDI<DIFile>(File), Line, RuntimeLang, SizeInBits,
1088 {UniqueIdentifier, UniqueIdentifierLen}));
1094 return wrap(
unwrap(Builder)->createQualifiedType(Tag,
1095 unwrapDI<DIType>(Type)));
1101 return wrap(
unwrap(Builder)->createReferenceType(Tag,
1102 unwrapDI<DIType>(Type)));
1107 return wrap(
unwrap(Builder)->createNullPtrType());
1114 uint64_t SizeInBits,
1117 return wrap(
unwrap(Builder)->createMemberPointerType(
1118 unwrapDI<DIType>(PointeeType),
1119 unwrapDI<DIType>(ClassType), AlignInBits, SizeInBits,
1126 const char *
Name,
size_t NameLen,
1128 uint64_t SizeInBits,
1129 uint64_t OffsetInBits,
1130 uint64_t StorageOffsetInBits,
1132 return wrap(
unwrap(Builder)->createBitFieldMemberType(
1133 unwrapDI<DIScope>(Scope), {
Name, NameLen},
1134 unwrapDI<DIFile>(
File), LineNumber,
1135 SizeInBits, OffsetInBits, StorageOffsetInBits,
1146 const char *UniqueIdentifier,
size_t UniqueIdentifierLen) {
1147 auto Elts =
unwrap(Builder)->getOrCreateArray({
unwrap(Elements),
1149 return wrap(
unwrap(Builder)->createClassType(
1150 unwrapDI<DIScope>(Scope), {
Name, NameLen},
1151 unwrapDI<DIFile>(
File), LineNumber,
1152 SizeInBits, AlignInBits, OffsetInBits,
1154 Elts, unwrapDI<DIType>(VTableHolder),
1155 unwrapDI<MDNode>(TemplateParamsNode),
1156 {UniqueIdentifier, UniqueIdentifierLen}));
1162 return wrap(
unwrap(Builder)->createArtificialType(unwrapDI<DIType>(Type)));
1167 *Length = Str.
size();
1176 return unwrapDI<DIType>(DType)->getOffsetInBits();
1180 return unwrapDI<DIType>(DType)->getAlignInBits();
1184 return unwrapDI<DIType>(DType)->getLine();
1195 unwrap(Builder)->getOrCreateTypeArray({
unwrap(Types), Length}).
get());
1202 unsigned NumParameterTypes,
1204 auto Elts =
unwrap(Builder)->getOrCreateTypeArray({
unwrap(ParameterTypes),
1205 NumParameterTypes});
1206 return wrap(
unwrap(Builder)->createSubroutineType(
1211 int64_t *Addr,
size_t Length) {
1219 return wrap(
unwrap(Builder)->createConstantValueExpression(Value));
1225 const char *
Name,
size_t NameLen,
1226 const char *Linkage,
size_t LinkLen,
1234 return wrap(
unwrap(Builder)->createGlobalVariableExpression(
1235 unwrapDI<DIScope>(Scope), {
Name, NameLen}, {Linkage, LinkLen},
1236 unwrapDI<DIFile>(
File), LineNo, unwrapDI<DIType>(Ty),
1237 LocalToUnit, unwrap<DIExpression>(Expr),
1238 unwrapDI<MDNode>(Decl), AlignInBits));
1253 auto *Node = unwrapDI<MDNode>(TargetMetadata);
1254 Node->replaceAllUsesWith(unwrap<Metadata>(Replacement));
1261 const char *
Name,
size_t NameLen,
1262 const char *Linkage,
size_t LnkLen,
1269 return wrap(
unwrap(Builder)->createTempGlobalVariableFwdDecl(
1270 unwrapDI<DIScope>(Scope), {
Name, NameLen}, {Linkage, LnkLen},
1271 unwrapDI<DIFile>(
File), LineNo, unwrapDI<DIType>(Ty),
1272 LocalToUnit, unwrapDI<MDNode>(Decl), AlignInBits));
1279 unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
1280 unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
1281 unwrap<Instruction>(Instr)));
1288 unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
1289 unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
1299 return wrap(
unwrap(Builder)->insertDbgValueIntrinsic(
1300 unwrap(Val), unwrap<DILocalVariable>(VarInfo),
1301 unwrap<DIExpression>(Expr), unwrap<DILocation>(DebugLoc),
1302 unwrap<Instruction>(Instr)));
1311 return wrap(
unwrap(Builder)->insertDbgValueIntrinsic(
1312 unwrap(Val), unwrap<DILocalVariable>(VarInfo),
1313 unwrap<DIExpression>(Expr), unwrap<DILocation>(DebugLoc),
1321 return wrap(
unwrap(Builder)->createAutoVariable(
1322 unwrap<DIScope>(Scope), {
Name, NameLen}, unwrap<DIFile>(
File),
1323 LineNo, unwrap<DIType>(Ty), AlwaysPreserve,
1331 return wrap(
unwrap(Builder)->createParameterVariable(
1332 unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File),
1333 LineNo, unwrap<DIType>(Ty), AlwaysPreserve,
1338 int64_t
Lo, int64_t Count) {
1339 return wrap(
unwrap(Builder)->getOrCreateSubrange(Lo, Count));
1346 return wrap(
unwrap(Builder)->getOrCreateArray({DataValue, Length}).
get());
1354 unwrap<Function>(Func)->setSubprogram(unwrap<DISubprogram>(SP));
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
void push_back(const T &Elt)
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.
Compute iterated dominance frontiers using a linear time algorithm.
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.
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
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
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.
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name, size_t NameLen, uint64_t SizeInBits, LLVMDWARFTypeEncoding Encoding)
Create debugging information entry for a basic type.
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
StringRef getFlags() const
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.
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
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)
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.
DILocalVariable * getVariable() const
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.
#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.
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.
static const DILocation * getMergedLocation(const DILocation *LocA, const DILocation *LocB, bool GenerateLocation=NoGeneratedLocation)
When two instructions are combined into a single instruction we also need to combine the original loc...
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.
bool getGnuPubnames() const
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)
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.
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.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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.
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