Ensure the System.Web.UI.WebControls.RepeatInfo_Autogen test runs under en-US
[mono.git] / mcs / class / Mono.CompilerServices.SymbolWriter / SymbolWriterImpl.cs
index 3958ea609d25bb0346e1505d5a62bdd2cc4cdc9e..0b25cd7cf5e2338315338b5c3924f2c9cde4cbc0 100644 (file)
@@ -50,7 +50,7 @@ namespace Mono.CompilerServices.SymbolWriter
 
                Hashtable documents = new Hashtable ();
 
-#if !CECIL
+#if !CECIL && !MOBILE
                ModuleBuilder mb;
                delegate Guid GetGuidFunc (ModuleBuilder mb);
                GetGuidFunc get_guid_func;
@@ -115,7 +115,9 @@ namespace Mono.CompilerServices.SymbolWriter
                {
                        SymbolDocumentWriterImpl doc = (SymbolDocumentWriterImpl) documents [url];
                        if (doc == null) {
-                               doc = new SymbolDocumentWriterImpl (msw.DefineDocument (url));
+                               SourceFileEntry entry = msw.DefineDocument (url);
+                               CompileUnitEntry comp_unit = msw.DefineCompilationUnit (entry);
+                               doc = new SymbolDocumentWriterImpl (comp_unit);
                                documents [url] = doc;
                        }
                        return doc;
@@ -155,7 +157,7 @@ namespace Mono.CompilerServices.SymbolWriter
                        int startOffset,
                        int endOffset)
                {
-                       msw.DefineLocalVariable (nextLocalIndex++, name, signature);
+                       msw.DefineLocalVariable (nextLocalIndex++, name);
                }
                
                public void DefineParameter (
@@ -177,10 +179,13 @@ namespace Mono.CompilerServices.SymbolWriter
                        int[] endLines,
                        int[] endColumns)
                {
+                       SymbolDocumentWriterImpl doc = (SymbolDocumentWriterImpl) document;
+                       SourceFileEntry file = doc != null ? doc.Entry.SourceFile : null;
+
                        for (int n=0; n<offsets.Length; n++) {
                                if (n > 0 && offsets[n] == offsets[n-1] && lines[n] == lines[n-1] && columns[n] == columns[n-1])
                                        continue;
-                               msw.MarkSequencePoint (offsets[n], lines[n], columns[n]);
+                               msw.MarkSequencePoint (offsets[n], file, lines[n], columns[n], false);
                        }
                }
                
@@ -201,7 +206,7 @@ namespace Mono.CompilerServices.SymbolWriter
                        n.Name = name;
                        namespaceStack.Push (n);
                }
-               
+
                public int OpenScope (int startOffset)
                {
                        return msw.OpenScope (startOffset);
@@ -215,8 +220,9 @@ namespace Mono.CompilerServices.SymbolWriter
                        int endLine,
                        int endColumn)
                {
-                       SourceMethodImpl sm = new SourceMethodImpl (methodName, currentToken, GetCurrentNamespace (startDoc));
-                       msw.OpenMethod (startDoc as ISourceFile, sm, startLine, startColumn, endLine, endColumn);
+                       int nsId = GetCurrentNamespace (startDoc);
+                       SourceMethodImpl sm = new SourceMethodImpl (methodName, currentToken, nsId);
+                       msw.OpenMethod (((ICompileUnit)startDoc).Entry, nsId, sm);
                        methodOpened = true;
                }
                
@@ -256,7 +262,7 @@ namespace Mono.CompilerServices.SymbolWriter
                        }
                        ni.UsingClauses.Add (fullName);
                }
-               
+
                int GetCurrentNamespace (ISymbolDocumentWriter doc)
                {
                        if (namespaceStack.Count == 0) {
@@ -275,19 +281,20 @@ namespace Mono.CompilerServices.SymbolWriter
                                        namespaceStack.Push (ni);
                                }
                                        
-                               ni.NamespaceID = msw.DefineNamespace (ni.Name, ((ISourceFile)doc).Entry, usings, parentId);
+                               ni.NamespaceID = msw.DefineNamespace (ni.Name, ((ICompileUnit)doc).Entry, usings, parentId);
                        }
                        return ni.NamespaceID;
                }
+
        }
        
-       class SymbolDocumentWriterImpl: ISymbolDocumentWriter, ISourceFile
+       class SymbolDocumentWriterImpl: ISymbolDocumentWriter, ISourceFile, ICompileUnit
        {
-               SourceFileEntry entry;
+               CompileUnitEntry comp_unit;
                
-               public SymbolDocumentWriterImpl (SourceFileEntry e)
+               public SymbolDocumentWriterImpl (CompileUnitEntry comp_unit)
                {
-                       entry = e;
+                       this.comp_unit = comp_unit;
                }
                
                public void SetCheckSum (Guid algorithmId, byte[] checkSum)
@@ -297,13 +304,17 @@ namespace Mono.CompilerServices.SymbolWriter
                public void SetSource (byte[] source)
                {
                }
+
+               SourceFileEntry ISourceFile.Entry {
+                       get { return comp_unit.SourceFile; }
+               }
                
-               public SourceFileEntry Entry {
-                       get { return entry; }
+               public CompileUnitEntry Entry {
+                       get { return comp_unit; }
                }
        }
        
-       class SourceMethodImpl: ISourceMethod
+       class SourceMethodImpl: IMethodDef
        {
                string name;
                int token;