diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMTypeRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMTypeRef.cs index 54b41a4..4b4f40a 100644 --- a/sources/LLVMSharp.Interop/Extensions/LLVMTypeRef.cs +++ b/sources/LLVMSharp.Interop/Extensions/LLVMTypeRef.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System; +using System.Diagnostics; namespace LLVMSharp.Interop; @@ -38,6 +39,7 @@ public unsafe partial struct LLVMTypeRef(IntPtr handle) : IEquatable LLVM.X86AMXType(); + [DebuggerBrowsable(DebuggerBrowsableState.Never)] // Justification: causes native allocation public readonly LLVMValueRef AlignOf => (Handle != IntPtr.Zero) ? LLVM.AlignOf(this) : default; public readonly uint ArrayLength => (Kind == LLVMTypeKind.LLVMArrayTypeKind) ? LLVM.GetArrayLength(this) : default; @@ -64,10 +66,12 @@ public unsafe partial struct LLVMTypeRef(IntPtr handle) : IEquatable (Kind == LLVMTypeKind.LLVMPointerTypeKind) ? LLVM.GetPointerAddressSpace(this) : default; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] // Justification: causes native allocation public readonly LLVMValueRef Poison => (Handle != IntPtr.Zero) ? LLVM.GetPoison(this) : default; public readonly LLVMTypeRef ReturnType => (Kind == LLVMTypeKind.LLVMFunctionTypeKind) ? LLVM.GetReturnType(this) : default; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] // Justification: causes native allocation public readonly LLVMValueRef SizeOf => (Handle != IntPtr.Zero) ? LLVM.SizeOf(this) : default; public readonly uint StructElementTypesCount => (Kind == LLVMTypeKind.LLVMStructTypeKind) ? LLVM.CountStructElementTypes(this) : default; @@ -94,6 +98,7 @@ public readonly string StructName public readonly uint SubtypesCount => (Handle != IntPtr.Zero) ? LLVM.GetNumContainedTypes(this) : default; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] // Justification: causes native allocation public readonly LLVMValueRef Undef => (Handle != IntPtr.Zero) ? LLVM.GetUndef(this) : default; public readonly uint VectorSize => (Kind == LLVMTypeKind.LLVMVectorTypeKind) ? LLVM.GetVectorSize(this) : default; diff --git a/sources/LLVMSharp.Interop/Extensions/LLVMValueRef.cs b/sources/LLVMSharp.Interop/Extensions/LLVMValueRef.cs index 41edce3..365d578 100644 --- a/sources/LLVMSharp.Interop/Extensions/LLVMValueRef.cs +++ b/sources/LLVMSharp.Interop/Extensions/LLVMValueRef.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System; +using System.Diagnostics; using static LLVMSharp.Interop.LLVMTailCallKind; namespace LLVMSharp.Interop; @@ -167,6 +168,7 @@ public readonly uint InstructionCallConv } } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] // Justification: causes native allocation public readonly LLVMValueRef InstructionClone => (Handle != IntPtr.Zero) ? LLVM.InstructionClone(this) : default; public readonly LLVMOpcode InstructionOpcode => (Handle != IntPtr.Zero) ? LLVM.GetInstructionOpcode(this) : default; @@ -548,6 +550,7 @@ public readonly string Section } } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] // Justification: can throw public readonly uint SuccessorsCount => (IsAInstruction != null) ? LLVM.GetNumSuccessors(this) : default; public readonly LLVMBasicBlockRef SwitchDefaultDest => (IsASwitchInst != null) ? LLVM.GetSwitchDefaultDest(this) : default;