2008-07-04 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / symbolwriter.cs
index 3d759a42fb30a7dcb62bec45af742acf35fad8c9..51ab4c9b2c505aabf7e4a76667db45fb11b0da0f 100644 (file)
@@ -4,7 +4,8 @@
 // Author:
 //   Martin Baulig (martin@ximian.com)
 //
-// (C) 2003 Ximian, Inc.
+// Copyright 2003 Ximian, Inc.
+// Copyright 2003-2008 Novell, Inc.
 //
 
 using System;
@@ -83,13 +84,13 @@ namespace Mono.CSharp {
                        }
                }
 
-               public static void OpenMethod (ISourceFile file, ISourceMethod method,
-                                              int start_row, int start_column,
-                                              int end_row, int end_column)
+               public static SourceMethodBuilder OpenMethod (ICompileUnit file, int ns_id,
+                                                             IMethodDef method)
                {
                        if (symwriter != null)
-                               symwriter.OpenMethod (file, method, start_row, start_column,
-                                                     end_row, end_column);
+                               return symwriter.OpenMethod (file, ns_id, method);
+                       else
+                               return null;
                }
 
                public static void CloseMethod ()
@@ -116,7 +117,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               public static int DefineNamespace (string name, SourceFileEntry source,
+               public static int DefineNamespace (string name, CompileUnitEntry source,
                                                   string[] using_clauses, int parent)
                {
                        if (symwriter != null)
@@ -128,138 +129,106 @@ namespace Mono.CSharp {
 #region Terrania additions
                public static void DefineAnonymousScope (int id)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null)
                                symwriter.DefineAnonymousScope (id);
-#endif
                }
 
                public static void DefineScopeVariable (int scope, LocalBuilder builder)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int index = MonoDebuggerSupport.GetLocalIndex (builder);
                                symwriter.DefineScopeVariable (scope, index);
                        }
-#endif
                }
 
                public static void DefineScopeVariable (int scope)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null)
                                symwriter.DefineScopeVariable (scope, -1);
-#endif
                }
 
                public static void DefineCapturedLocal (int scope_id, string name,
                                                        string captured_name)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null)
                                symwriter.DefineCapturedLocal (scope_id, name, captured_name);
-#endif
                }
 
                public static void DefineCapturedParameter (int scope_id, string name,
                                                            string captured_name)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null)
                                symwriter.DefineCapturedParameter (scope_id, name, captured_name);
-#endif
                }
 
                public static void DefineCapturedThis (int scope_id, string captured_name)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null)
                                symwriter.DefineCapturedThis (scope_id, captured_name);
-#endif
                }
 
                public static void DefineCapturedScope (int scope_id, int id, string captured_name)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null)
                                symwriter.DefineCapturedScope (scope_id, id, captured_name);
-#endif
-               }
-
-               public static void SetRealMethodName (string name)
-               {
-#if !DISABLE_TERRANIA_CHANGES
-                       if (symwriter != null)
-                               symwriter.SetRealMethodName (name);
-#endif
                }
 
                public static void OpenCompilerGeneratedBlock (ILGenerator ig)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int offset = symwriter.GetILOffset (ig);
                                symwriter.OpenCompilerGeneratedBlock (offset);
                        }
-#endif
                }
 
                public static void CloseCompilerGeneratedBlock (ILGenerator ig)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int offset = symwriter.GetILOffset (ig);
                                symwriter.CloseCompilerGeneratedBlock (offset);
                        }
-#endif
                }
 
                public static void StartIteratorBody (ILGenerator ig)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int offset = symwriter.GetILOffset (ig);
                                symwriter.StartIteratorBody (offset);
                        }
-#endif
                }
 
                public static void EndIteratorBody (ILGenerator ig)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int offset = symwriter.GetILOffset (ig);
                                symwriter.EndIteratorBody (offset);
                        }
-#endif
                }
 
                public static void StartIteratorDispatcher (ILGenerator ig)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int offset = symwriter.GetILOffset (ig);
                                symwriter.StartIteratorDispatcher (offset);
                        }
-#endif
                }
 
                public static void EndIteratorDispatcher (ILGenerator ig)
                {
-#if !DISABLE_TERRANIA_CHANGES
                        if (symwriter != null) {
                                int offset = symwriter.GetILOffset (ig);
                                symwriter.EndIteratorDispatcher (offset);
                        }
-#endif
                }
 #endregion
 
-               public static void MarkSequencePoint (ILGenerator ig, int row, int column)
+               public static void MarkSequencePoint (ILGenerator ig, Location loc)
                {
                        if (symwriter != null) {
+                               SourceFileEntry file = loc.SourceFile.SourceFileEntry;
                                int offset = symwriter.GetILOffset (ig);
-                               symwriter.MarkSequencePoint (offset, row, column);
+                               symwriter.MarkSequencePoint (
+                                       offset, file, loc.Row, loc.Column, loc.Hidden);
                        }
                }