예제 #1
0
파일: DIBuilder.cs 프로젝트: sfuller/MonC
 public unsafe Metadata CreateParameterVariable(Metadata scope, string name, uint argNo, Metadata file,
                                                uint lineNo, Metadata ty, bool alwaysPreserve, LLVMDIFlags flags)
 {
     using var marshaledName = new MarshaledString(name.AsSpan());
     return((LLVMMetadataRef)LLVMSharp.Interop.LLVM.DIBuilderCreateParameterVariable(_builder,
                                                                                     (LLVMMetadataRef)scope, marshaledName, (UIntPtr)name.Length, argNo, (LLVMMetadataRef)file, lineNo,
                                                                                     (LLVMMetadataRef)ty, alwaysPreserve ? 1 : 0, flags));
 }
예제 #2
0
파일: DIBuilder.cs 프로젝트: sfuller/MonC
 public unsafe Metadata CreatePointerType(Metadata pointeeTy, ulong sizeInBits, uint alignInBits,
                                          uint addressSpace = 0, string name = "")
 {
     using var marshaledName = new MarshaledString(name.AsSpan());
     return((LLVMMetadataRef)LLVMSharp.Interop.LLVM.DIBuilderCreatePointerType(_builder,
                                                                               (LLVMMetadataRef)pointeeTy, sizeInBits, alignInBits, addressSpace, marshaledName,
                                                                               (UIntPtr)name.Length));
 }
예제 #3
0
파일: DIBuilder.cs 프로젝트: sfuller/MonC
 public unsafe Metadata CreateReplaceableCompositeType(LLVMDWARFTag tag, string name, Metadata scope,
                                                       Metadata file, uint line, uint runtimeLang, ulong sizeInBits, uint alignInBits, LLVMDIFlags flags,
                                                       string uniqueIdentifier)
 {
     using var marshaledName     = new MarshaledString(name.AsSpan());
     using var marshaledUniqueId = new MarshaledString(uniqueIdentifier.AsSpan());
     return((LLVMMetadataRef)LLVMSharp.Interop.LLVM.DIBuilderCreateReplaceableCompositeType(_builder,
                                                                                            (uint)tag, marshaledName, (UIntPtr)name.Length, (LLVMMetadataRef)scope, (LLVMMetadataRef)file, line,
                                                                                            runtimeLang, sizeInBits, alignInBits, flags, marshaledUniqueId, (UIntPtr)uniqueIdentifier.Length));
 }
예제 #4
0
파일: DIBuilder.cs 프로젝트: sfuller/MonC
 public unsafe Metadata CreateEnumerationType(Metadata scope, string name, Metadata file, uint lineNumber,
                                              ulong sizeInBits, uint alignInBits, Metadata[] elements, Metadata classTy)
 {
     using var marshaledName = new MarshaledString(name.AsSpan());
     fixed(LLVMMetadataRef *castElems = Array.ConvertAll(elements, elem => (LLVMMetadataRef)elem).AsSpan())
     {
         return((LLVMMetadataRef)LLVMSharp.Interop.LLVM.DIBuilderCreateEnumerationType(_builder,
                                                                                       (LLVMMetadataRef)scope, marshaledName, (UIntPtr)name.Length, (LLVMMetadataRef)file, lineNumber,
                                                                                       sizeInBits, alignInBits, (LLVMOpaqueMetadata **)castElems, (uint)elements.Length,
                                                                                       (LLVMMetadataRef)classTy));
     }
 }
예제 #5
0
파일: DIBuilder.cs 프로젝트: sfuller/MonC
 public unsafe Metadata CreateStructType(Metadata scope, string name, Metadata file, uint lineNumber,
                                         ulong sizeInBits, uint alignInBits, LLVMDIFlags flags, Metadata derivedFrom, Metadata[] elements,
                                         uint runTimeLang, Metadata vTableHolder, string uniqueId)
 {
     using var marshaledName     = new MarshaledString(name.AsSpan());
     using var marshaledUniqueId = new MarshaledString(uniqueId.AsSpan());
     fixed(LLVMMetadataRef *castElems = Array.ConvertAll(elements, elem => (LLVMMetadataRef)elem).AsSpan())
     {
         return((LLVMMetadataRef)LLVMSharp.Interop.LLVM.DIBuilderCreateStructType(_builder,
                                                                                  (LLVMMetadataRef)scope, marshaledName, (UIntPtr)marshaledName.Length, (LLVMMetadataRef)file,
                                                                                  lineNumber, sizeInBits, alignInBits, flags, (LLVMMetadataRef)derivedFrom,
                                                                                  (LLVMOpaqueMetadata **)castElems, (uint)elements.Length, runTimeLang,
                                                                                  (LLVMMetadataRef)vTableHolder, marshaledUniqueId, (UIntPtr)marshaledUniqueId.Length));
     }
 }
예제 #6
0
파일: DIBuilder.cs 프로젝트: sfuller/MonC
 public unsafe Metadata CreateEnumerator(string name, long value, bool isUnsigned)
 {
     using var marshaledName = new MarshaledString(name.AsSpan());
     return((LLVMMetadataRef)LLVMSharp.Interop.LLVM.DIBuilderCreateEnumerator(_builder, marshaledName,
                                                                              (UIntPtr)name.Length, value, isUnsigned ? 1 : 0));
 }
예제 #7
0
파일: Module.cs 프로젝트: sfuller/MonC
 public unsafe void AddModuleFlag(LLVMModuleFlagBehavior behavior, string key, Metadata val)
 {
     using var marshaledKey = new MarshaledString(key.AsSpan());
     LLVMSharp.Interop.LLVM.AddModuleFlag(_module, behavior, marshaledKey, (UIntPtr)key.Length,
                                          (LLVMMetadataRef)val);
 }