diff options
Diffstat (limited to 'src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter_Statics.cs')
-rw-r--r-- | src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter_Statics.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter_Statics.cs b/src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter_Statics.cs index ad6bc1c78..5bbfc2906 100644 --- a/src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter_Statics.cs +++ b/src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter_Statics.cs @@ -51,8 +51,9 @@ namespace Internal.IL try { string mangledName; - // TODO: We should use the startup node to generate StartupCodeMain and avoid special casing here - if (methodCodeNodeNeedingCode.Method.Signature.IsStatic && methodCodeNodeNeedingCode.Method.Name == "Main") + + // TODO: Better detection of the StartupCodeMain method + if (methodCodeNodeNeedingCode.Method.Signature.IsStatic && methodCodeNodeNeedingCode.Method.Name == "StartupCodeMain") { mangledName = "StartupCodeMain"; } @@ -96,6 +97,17 @@ namespace Internal.IL //methodCodeNodeNeedingCode.SetCode(sb.ToString(), Array.Empty<Object>()); } + // Uncomment the block below to get specific method failures when LLVM fails for cryptic reasons +#if false + LLVMBool result = LLVM.VerifyFunction(ilImporter._llvmFunction, LLVMVerifierFailureAction.LLVMPrintMessageAction); + if (result.Value != 0) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"Error compliling {method.OwningType}.{method}"); + Console.ResetColor(); + } +#endif // false + // Ensure dependencies show up regardless of exceptions to avoid breaking LLVM methodCodeNodeNeedingCode.SetDependencies(ilImporter.GetDependencies()); } |