コード例 #1
0
ファイル: InvocationContext.cs プロジェクト: adamreeve/ILGPU
 /// <summary>
 /// Declares a new top-level function.
 /// </summary>
 /// <param name="methodBase">The method to declare.</param>
 /// <returns>The declared top-level function.</returns>
 public Method DeclareFunction(MethodBase methodBase)
 {
     if (methodBase == null)
     {
         throw Location.GetArgumentNullException(nameof(methodBase));
     }
     return(CodeGenerator.DeclareMethod(methodBase));
 }
コード例 #2
0
 /// <summary>
 /// Declares a (potentially new) method.
 /// </summary>
 /// <param name="methodBase">The method to declare.</param>
 /// <returns>The declared method reference.</returns>
 public Method DeclareMethod(MethodBase methodBase) =>
 methodBase != null
     ? CodeGenerator.DeclareMethod(methodBase)
     : throw Location.GetArgumentNullException(nameof(methodBase));