1 //===- dibuilder.go - Bindings for DIBuilder ------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines bindings for the DIBuilder class.
11 //===----------------------------------------------------------------------===//
16 #include "IRBindings.h"
29 DW_TAG_lexical_block DwarfTag
= 0x0b
30 DW_TAG_compile_unit DwarfTag
= 0x11
31 DW_TAG_variable DwarfTag
= 0x34
32 DW_TAG_base_type DwarfTag
= 0x24
33 DW_TAG_pointer_type DwarfTag
= 0x0F
34 DW_TAG_structure_type DwarfTag
= 0x13
35 DW_TAG_subroutine_type DwarfTag
= 0x15
36 DW_TAG_file_type DwarfTag
= 0x29
37 DW_TAG_subprogram DwarfTag
= 0x2E
38 DW_TAG_auto_variable DwarfTag
= 0x100
39 DW_TAG_arg_variable DwarfTag
= 0x101
43 FlagPrivate
= 1 << iota
57 FlagArgumentNotModified
63 // http://dwarfstd.org/ShowIssue.php?issue=101014.1&type=open
64 DW_LANG_Go DwarfLang
= 0x0016
67 type DwarfTypeEncoding
uint32
70 DW_ATE_address DwarfTypeEncoding
= 0x01
71 DW_ATE_boolean DwarfTypeEncoding
= 0x02
72 DW_ATE_complex_float DwarfTypeEncoding
= 0x03
73 DW_ATE_float DwarfTypeEncoding
= 0x04
74 DW_ATE_signed DwarfTypeEncoding
= 0x05
75 DW_ATE_signed_char DwarfTypeEncoding
= 0x06
76 DW_ATE_unsigned DwarfTypeEncoding
= 0x07
77 DW_ATE_unsigned_char DwarfTypeEncoding
= 0x08
78 DW_ATE_imaginary_float DwarfTypeEncoding
= 0x09
79 DW_ATE_packed_decimal DwarfTypeEncoding
= 0x0a
80 DW_ATE_numeric_string DwarfTypeEncoding
= 0x0b
81 DW_ATE_edited DwarfTypeEncoding
= 0x0c
82 DW_ATE_signed_fixed DwarfTypeEncoding
= 0x0d
83 DW_ATE_unsigned_fixed DwarfTypeEncoding
= 0x0e
84 DW_ATE_decimal_float DwarfTypeEncoding
= 0x0f
85 DW_ATE_UTF DwarfTypeEncoding
= 0x10
86 DW_ATE_lo_user DwarfTypeEncoding
= 0x80
87 DW_ATE_hi_user DwarfTypeEncoding
= 0xff
90 // DIBuilder is a wrapper for the LLVM DIBuilder class.
91 type DIBuilder
struct {
92 ref C
.LLVMDIBuilderRef
96 // NewDIBuilder creates a new DIBuilder, associated with the given module.
97 func NewDIBuilder(m Module
) *DIBuilder
{
98 d
:= C
.LLVMCreateDIBuilder(m
.C
)
99 return &DIBuilder
{ref
: d
, m
: m
}
102 // Destroy destroys the DIBuilder.
103 func (d
*DIBuilder
) Destroy() {
104 C
.LLVMDisposeDIBuilder(d
.ref
)
107 // FInalize finalizes the debug information generated by the DIBuilder.
108 func (d
*DIBuilder
) Finalize() {
109 C
.LLVMDIBuilderFinalize(d
.ref
)
112 // DICompileUnit holds the values for creating compile unit debug metadata.
113 type DICompileUnit
struct {
123 // CreateCompileUnit creates compile unit debug metadata.
124 func (d
*DIBuilder
) CreateCompileUnit(cu DICompileUnit
) Metadata
{
125 file
:= C
.CString(cu
.File
)
126 defer C
.free(unsafe
.Pointer(file
))
127 dir
:= C
.CString(cu
.Dir
)
128 defer C
.free(unsafe
.Pointer(dir
))
129 producer
:= C
.CString(cu
.Producer
)
130 defer C
.free(unsafe
.Pointer(producer
))
131 flags
:= C
.CString(cu
.Flags
)
132 defer C
.free(unsafe
.Pointer(flags
))
133 result
:= C
.LLVMDIBuilderCreateCompileUnit(
135 C
.LLVMDWARFSourceLanguage(cu
.Language
),
136 C
.LLVMDIBuilderCreateFile(d
.ref
, file
, C
.size_t(len(cu
.File
)), dir
, C
.size_t(len(cu
.Dir
))),
137 producer
, C
.size_t(len(cu
.Producer
)),
138 C
.LLVMBool(boolToCInt(cu
.Optimized
)),
139 flags
, C
.size_t(len(cu
.Flags
)),
140 C
.unsigned(cu
.RuntimeVersion
),
141 /*SplitName=*/ nil, 0,
142 C
.LLVMDWARFEmissionFull
,
144 /*SplitDebugInlining*/ C
.LLVMBool(boolToCInt(true)),
145 /*DebugInfoForProfiling*/ C
.LLVMBool(boolToCInt(false)),
147 return Metadata
{C
: result
}
150 // CreateFile creates file debug metadata.
151 func (d
*DIBuilder
) CreateFile(filename
, dir
string) Metadata
{
152 cfilename
:= C
.CString(filename
)
153 defer C
.free(unsafe
.Pointer(cfilename
))
154 cdir
:= C
.CString(dir
)
155 defer C
.free(unsafe
.Pointer(cdir
))
156 result
:= C
.LLVMDIBuilderCreateFile(d
.ref
,
157 cfilename
, C
.size_t(len(filename
)),
158 cdir
, C
.size_t(len(dir
)))
159 return Metadata
{C
: result
}
162 // DILexicalBlock holds the values for creating lexical block debug metadata.
163 type DILexicalBlock
struct {
169 // CreateLexicalBlock creates lexical block debug metadata.
170 func (d
*DIBuilder
) CreateLexicalBlock(diScope Metadata
, b DILexicalBlock
) Metadata
{
171 result
:= C
.LLVMDIBuilderCreateLexicalBlock(
176 C
.unsigned(b
.Column
),
178 return Metadata
{C
: result
}
181 func (d
*DIBuilder
) CreateLexicalBlockFile(diScope Metadata
, diFile Metadata
, discriminator
int) Metadata
{
182 result
:= C
.LLVMDIBuilderCreateLexicalBlockFile(d
.ref
, diScope
.C
, diFile
.C
,
183 C
.unsigned(discriminator
))
184 return Metadata
{C
: result
}
187 // DIFunction holds the values for creating function debug metadata.
188 type DIFunction
struct {
201 // CreateFunction creates function debug metadata.
202 func (d
*DIBuilder
) CreateFunction(diScope Metadata
, f DIFunction
) Metadata
{
203 name
:= C
.CString(f
.Name
)
204 defer C
.free(unsafe
.Pointer(name
))
205 linkageName
:= C
.CString(f
.LinkageName
)
206 defer C
.free(unsafe
.Pointer(linkageName
))
207 result
:= C
.LLVMDIBuilderCreateFunction(
210 name
, C
.size_t(len(f
.Name
)),
211 linkageName
, C
.size_t(len(f
.LinkageName
)),
215 C
.LLVMBool(boolToCInt(f
.LocalToUnit
)),
216 C
.LLVMBool(boolToCInt(f
.IsDefinition
)),
217 C
.unsigned(f
.ScopeLine
),
218 C
.LLVMDIFlags(f
.Flags
),
219 C
.LLVMBool(boolToCInt(f
.Optimized
)),
221 return Metadata
{C
: result
}
224 // DIAutoVariable holds the values for creating auto variable debug metadata.
225 type DIAutoVariable
struct {
235 // CreateAutoVariable creates local variable debug metadata.
236 func (d
*DIBuilder
) CreateAutoVariable(scope Metadata
, v DIAutoVariable
) Metadata
{
237 name
:= C
.CString(v
.Name
)
238 defer C
.free(unsafe
.Pointer(name
))
239 result
:= C
.LLVMDIBuilderCreateAutoVariable(
242 name
, C
.size_t(len(v
.Name
)),
246 C
.LLVMBool(boolToCInt(v
.AlwaysPreserve
)),
247 C
.LLVMDIFlags(v
.Flags
),
248 C
.uint32_t(v
.AlignInBits
),
250 return Metadata
{C
: result
}
253 // DIParameterVariable holds the values for creating parameter variable debug metadata.
254 type DIParameterVariable
struct {
262 // ArgNo is the 1-based index of the argument in the function's
267 // CreateParameterVariable creates parameter variable debug metadata.
268 func (d
*DIBuilder
) CreateParameterVariable(scope Metadata
, v DIParameterVariable
) Metadata
{
269 name
:= C
.CString(v
.Name
)
270 defer C
.free(unsafe
.Pointer(name
))
271 result
:= C
.LLVMDIBuilderCreateParameterVariable(
274 name
, C
.size_t(len(v
.Name
)),
279 C
.LLVMBool(boolToCInt(v
.AlwaysPreserve
)),
280 C
.LLVMDIFlags(v
.Flags
),
282 return Metadata
{C
: result
}
285 // DIBasicType holds the values for creating basic type debug metadata.
286 type DIBasicType
struct {
289 Encoding DwarfTypeEncoding
292 // CreateBasicType creates basic type debug metadata.
293 func (d
*DIBuilder
) CreateBasicType(t DIBasicType
) Metadata
{
294 name
:= C
.CString(t
.Name
)
295 defer C
.free(unsafe
.Pointer(name
))
296 result
:= C
.LLVMDIBuilderCreateBasicType(
299 C
.size_t(len(t
.Name
)),
300 C
.uint64_t(t
.SizeInBits
),
301 C
.LLVMDWARFTypeEncoding(t
.Encoding
),
304 return Metadata
{C
: result
}
307 // DIPointerType holds the values for creating pointer type debug metadata.
308 type DIPointerType
struct {
311 AlignInBits
uint32 // optional
313 Name
string // optional
316 // CreatePointerType creates a type that represents a pointer to another type.
317 func (d
*DIBuilder
) CreatePointerType(t DIPointerType
) Metadata
{
318 name
:= C
.CString(t
.Name
)
319 defer C
.free(unsafe
.Pointer(name
))
320 result
:= C
.LLVMDIBuilderCreatePointerType(
323 C
.uint64_t(t
.SizeInBits
),
324 C
.uint32_t(t
.AlignInBits
),
325 C
.unsigned(t
.AddressSpace
),
327 C
.size_t(len(t
.Name
)),
329 return Metadata
{C
: result
}
332 // DISubroutineType holds the values for creating subroutine type debug metadata.
333 type DISubroutineType
struct {
334 // File is the file in which the subroutine type is defined.
337 // Parameters contains the subroutine parameter types,
338 // including the return type at the 0th index.
339 Parameters
[]Metadata
344 // CreateSubroutineType creates subroutine type debug metadata.
345 func (d
*DIBuilder
) CreateSubroutineType(t DISubroutineType
) Metadata
{
346 params
, length
:= llvmMetadataRefs(t
.Parameters
)
347 result
:= C
.LLVMDIBuilderCreateSubroutineType(
352 C
.LLVMDIFlags(t
.Flags
),
354 return Metadata
{C
: result
}
357 // DIStructType holds the values for creating struct type debug metadata.
358 type DIStructType
struct {
367 VTableHolder Metadata
// optional
371 // CreateStructType creates struct type debug metadata.
372 func (d
*DIBuilder
) CreateStructType(scope Metadata
, t DIStructType
) Metadata
{
373 elements
, length
:= llvmMetadataRefs(t
.Elements
)
374 name
:= C
.CString(t
.Name
)
375 uniqueID
:= C
.CString(t
.UniqueID
)
376 defer C
.free(unsafe
.Pointer(name
))
377 defer C
.free(unsafe
.Pointer(uniqueID
))
378 result
:= C
.LLVMDIBuilderCreateStructType(
382 C
.size_t(len(t
.Name
)),
385 C
.uint64_t(t
.SizeInBits
),
386 C
.uint32_t(t
.AlignInBits
),
387 C
.LLVMDIFlags(t
.Flags
),
391 C
.unsigned(0), // Optional Objective-C runtime version.
394 C
.size_t(len(t
.UniqueID
)),
396 return Metadata
{C
: result
}
399 // DIReplaceableCompositeType holds the values for creating replaceable
400 // composite type debug metadata.
401 type DIReplaceableCompositeType
struct {
413 // CreateReplaceableCompositeType creates replaceable composite type debug metadata.
414 func (d
*DIBuilder
) CreateReplaceableCompositeType(scope Metadata
, t DIReplaceableCompositeType
) Metadata
{
415 name
:= C
.CString(t
.Name
)
416 uniqueID
:= C
.CString(t
.UniqueID
)
417 defer C
.free(unsafe
.Pointer(name
))
418 defer C
.free(unsafe
.Pointer(uniqueID
))
419 result
:= C
.LLVMDIBuilderCreateReplaceableCompositeType(
423 C
.size_t(len(t
.Name
)),
427 C
.unsigned(t
.RuntimeLang
),
428 C
.uint64_t(t
.SizeInBits
),
429 C
.uint32_t(t
.AlignInBits
),
430 C
.LLVMDIFlags(t
.Flags
),
432 C
.size_t(len(t
.UniqueID
)),
434 return Metadata
{C
: result
}
437 // DIMemberType holds the values for creating member type debug metadata.
438 type DIMemberType
struct {
449 // CreateMemberType creates struct type debug metadata.
450 func (d
*DIBuilder
) CreateMemberType(scope Metadata
, t DIMemberType
) Metadata
{
451 name
:= C
.CString(t
.Name
)
452 defer C
.free(unsafe
.Pointer(name
))
453 result
:= C
.LLVMDIBuilderCreateMemberType(
457 C
.size_t(len(t
.Name
)),
460 C
.uint64_t(t
.SizeInBits
),
461 C
.uint32_t(t
.AlignInBits
),
462 C
.uint64_t(t
.OffsetInBits
),
463 C
.LLVMDIFlags(t
.Flags
),
466 return Metadata
{C
: result
}
469 // DISubrange describes an integer value range.
470 type DISubrange
struct {
475 // DIArrayType holds the values for creating array type debug metadata.
476 type DIArrayType
struct {
480 Subscripts
[]DISubrange
483 // CreateArrayType creates struct type debug metadata.
484 func (d
*DIBuilder
) CreateArrayType(t DIArrayType
) Metadata
{
485 subscriptsSlice
:= make([]Metadata
, len(t
.Subscripts
))
486 for i
, s
:= range t
.Subscripts
{
487 subscriptsSlice
[i
] = d
.getOrCreateSubrange(s
.Lo
, s
.Count
)
489 subscripts
, length
:= llvmMetadataRefs(subscriptsSlice
)
490 result
:= C
.LLVMDIBuilderCreateArrayType(
492 C
.uint64_t(t
.SizeInBits
),
493 C
.uint32_t(t
.AlignInBits
),
498 return Metadata
{C
: result
}
501 // DITypedef holds the values for creating typedef type debug metadata.
502 type DITypedef
struct {
510 // CreateTypedef creates typedef type debug metadata.
511 func (d
*DIBuilder
) CreateTypedef(t DITypedef
) Metadata
{
512 name
:= C
.CString(t
.Name
)
513 defer C
.free(unsafe
.Pointer(name
))
514 result
:= C
.LLVMDIBuilderCreateTypedef(
518 C
.size_t(len(t
.Name
)),
523 return Metadata
{C
: result
}
526 // getOrCreateSubrange gets a metadata node for the specified subrange,
527 // creating if required.
528 func (d
*DIBuilder
) getOrCreateSubrange(lo
, count
int64) Metadata
{
529 result
:= C
.LLVMDIBuilderGetOrCreateSubrange(d
.ref
, C
.int64_t(lo
), C
.int64_t(count
))
530 return Metadata
{C
: result
}
533 // getOrCreateArray gets a metadata node containing the specified values,
534 // creating if required.
535 func (d
*DIBuilder
) getOrCreateArray(values
[]Metadata
) Metadata
{
536 if len(values
) == 0 {
539 data
, length
:= llvmMetadataRefs(values
)
540 result
:= C
.LLVMDIBuilderGetOrCreateArray(d
.ref
, data
, C
.size_t(length
))
541 return Metadata
{C
: result
}
544 // getOrCreateTypeArray gets a metadata node for a type array containing the
545 // specified values, creating if required.
546 func (d
*DIBuilder
) getOrCreateTypeArray(values
[]Metadata
) Metadata
{
547 if len(values
) == 0 {
550 data
, length
:= llvmMetadataRefs(values
)
551 result
:= C
.LLVMDIBuilderGetOrCreateTypeArray(d
.ref
, data
, C
.size_t(length
))
552 return Metadata
{C
: result
}
555 // CreateExpression creates a new descriptor for the specified
556 // variable which has a complex address expression for its address.
557 func (d
*DIBuilder
) CreateExpression(addr
[]int64) Metadata
{
560 data
= (*C
.int64_t
)(unsafe
.Pointer(&addr
[0]))
562 result
:= C
.LLVMDIBuilderCreateExpression(d
.ref
, data
, C
.size_t(len(addr
)))
563 return Metadata
{C
: result
}
566 // InsertDeclareAtEnd inserts a call to llvm.dbg.declare at the end of the
567 // specified basic block for the given value and associated debug metadata.
568 func (d
*DIBuilder
) InsertDeclareAtEnd(v Value
, diVarInfo
, expr Metadata
, l DebugLoc
, bb BasicBlock
) Value
{
569 loc
:= C
.LLVMDIBuilderCreateDebugLocation(
570 d
.m
.Context().C
, C
.uint(l
.Line
), C
.uint(l
.Col
), l
.Scope
.C
, l
.InlinedAt
.C
)
571 result
:= C
.LLVMDIBuilderInsertDeclareAtEnd(d
.ref
, v
.C
, diVarInfo
.C
, expr
.C
, loc
, bb
.C
)
572 return Value
{C
: result
}
575 // InsertValueAtEnd inserts a call to llvm.dbg.value at the end of the
576 // specified basic block for the given value and associated debug metadata.
577 func (d
*DIBuilder
) InsertValueAtEnd(v Value
, diVarInfo
, expr Metadata
, l DebugLoc
, bb BasicBlock
) Value
{
578 loc
:= C
.LLVMDIBuilderCreateDebugLocation(
579 d
.m
.Context().C
, C
.uint(l
.Line
), C
.uint(l
.Col
), l
.Scope
.C
, l
.InlinedAt
.C
)
580 result
:= C
.LLVMDIBuilderInsertDbgValueAtEnd(d
.ref
, v
.C
, diVarInfo
.C
, expr
.C
, loc
, bb
.C
)
581 return Value
{C
: result
}
584 func (v Value
) SetSubprogram(sp Metadata
) {
585 C
.LLVMSetSubprogram(v
.C
, sp
.C
)
588 func boolToCInt(v
bool) C
.int {
595 //-------------------------------------------------------------------------
597 //-------------------------------------------------------------------------
599 func (c Context
) TemporaryMDNode(mds
[]Metadata
) (md Metadata
) {
600 ptr
, nvals
:= llvmMetadataRefs(mds
)
601 md
.C
= C
.LLVMTemporaryMDNode(c
.C
, ptr
, C
.size_t(nvals
))
605 func (md Metadata
) ReplaceAllUsesWith(new Metadata
) {
606 C
.LLVMMetadataReplaceAllUsesWith(md
.C
, new.C
)
609 type MetadataKind C
.LLVMMetadataKind
612 MDStringMetadataKind
= C
.LLVMMDStringMetadataKind
613 ConstantAsMetadataMetadataKind
= C
.LLVMConstantAsMetadataMetadataKind
614 LocalAsMetadataMetadataKind
= C
.LLVMLocalAsMetadataMetadataKind
615 DistinctMDOperandPlaceholderMetadataKind
= C
.LLVMDistinctMDOperandPlaceholderMetadataKind
616 MDTupleMetadataKind
= C
.LLVMMDTupleMetadataKind
617 DILocationMetadataKind
= C
.LLVMDILocationMetadataKind
618 DIExpressionMetadataKind
= C
.LLVMDIExpressionMetadataKind
619 DIGlobalVariableExpressionMetadataKind
= C
.LLVMDIGlobalVariableExpressionMetadataKind
620 GenericDINodeMetadataKind
= C
.LLVMGenericDINodeMetadataKind
621 DISubrangeMetadataKind
= C
.LLVMDISubrangeMetadataKind
622 DIEnumeratorMetadataKind
= C
.LLVMDIEnumeratorMetadataKind
623 DIBasicTypeMetadataKind
= C
.LLVMDIBasicTypeMetadataKind
624 DIDerivedTypeMetadataKind
= C
.LLVMDIDerivedTypeMetadataKind
625 DICompositeTypeMetadataKind
= C
.LLVMDICompositeTypeMetadataKind
626 DISubroutineTypeMetadataKind
= C
.LLVMDISubroutineTypeMetadataKind
627 DIFileMetadataKind
= C
.LLVMDIFileMetadataKind
628 DICompileUnitMetadataKind
= C
.LLVMDICompileUnitMetadataKind
629 DISubprogramMetadataKind
= C
.LLVMDISubprogramMetadataKind
630 DILexicalBlockMetadataKind
= C
.LLVMDILexicalBlockMetadataKind
631 DILexicalBlockFileMetadataKind
= C
.LLVMDILexicalBlockFileMetadataKind
632 DINamespaceMetadataKind
= C
.LLVMDINamespaceMetadataKind
633 DIModuleMetadataKind
= C
.LLVMDIModuleMetadataKind
634 DITemplateTypeParameterMetadataKind
= C
.LLVMDITemplateTypeParameterMetadataKind
635 DITemplateValueParameterMetadataKind
= C
.LLVMDITemplateValueParameterMetadataKind
636 DIGlobalVariableMetadataKind
= C
.LLVMDIGlobalVariableMetadataKind
637 DILocalVariableMetadataKind
= C
.LLVMDILocalVariableMetadataKind
638 DILabelMetadataKind
= C
.LLVMDILabelMetadataKind
639 DIObjCPropertyMetadataKind
= C
.LLVMDIObjCPropertyMetadataKind
640 DIImportedEntityMetadataKind
= C
.LLVMDIImportedEntityMetadataKind
641 DIMacroMetadataKind
= C
.LLVMDIMacroMetadataKind
642 DIMacroFileMetadataKind
= C
.LLVMDIMacroFileMetadataKind
643 DICommonBlockMetadataKind
= C
.LLVMDICommonBlockMetadataKind
646 // Kind returns the metadata kind.
647 func (md Metadata
) Kind() MetadataKind
{
648 return MetadataKind(C
.LLVMGetMetadataKind(md
.C
))
651 // FileDirectory returns the directory of a DIFile metadata node.
652 func (md Metadata
) FileDirectory() string {
653 var length C
.unsigned
654 ptr
:= C
.LLVMDIFileGetDirectory(md
.C
, &length
)
655 return string(((*[1 << 20]byte)(unsafe
.Pointer(ptr
)))[:length
:length
])
658 // FileFilename returns the filename of a DIFile metadata node.
659 func (md Metadata
) FileFilename() string {
660 var length C
.unsigned
661 ptr
:= C
.LLVMDIFileGetFilename(md
.C
, &length
)
662 return string(((*[1 << 20]byte)(unsafe
.Pointer(ptr
)))[:length
:length
])
665 // FileSource returns the source of a DIFile metadata node.
666 func (md Metadata
) FileSource() string {
667 var length C
.unsigned
668 ptr
:= C
.LLVMDIFileGetSource(md
.C
, &length
)
669 return string(((*[1 << 20]byte)(unsafe
.Pointer(ptr
)))[:length
:length
])
672 // LocationLine returns the line number of a DILocation.
673 func (md Metadata
) LocationLine() uint {
674 return uint(C
.LLVMDILocationGetLine(md
.C
))
677 // LocationColumn returns the column (offset from the start of the line) of a
679 func (md Metadata
) LocationColumn() uint {
680 return uint(C
.LLVMDILocationGetColumn(md
.C
))
683 // LocationScope returns the local scope associated with this debug location.
684 func (md Metadata
) LocationScope() Metadata
{
685 return Metadata
{C
.LLVMDILocationGetScope(md
.C
)}
688 // LocationInlinedAt return the "inline at" location associated with this debug
690 func (md Metadata
) LocationInlinedAt() Metadata
{
691 return Metadata
{C
.LLVMDILocationGetInlinedAt(md
.C
)}
694 // ScopeFile returns the file (DIFile) of a given scope.
695 func (md Metadata
) ScopeFile() Metadata
{
696 return Metadata
{C
.LLVMDIScopeGetFile(md
.C
)}