// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // // method.hpp // #ifndef _METHOD_HPP #define _METHOD_HPP class Assembler; class PermissionDecl; class PermissionSetDecl; #define MAX_EXCEPTIONS 16 // init.number; increased by 16 when needed extern unsigned int g_uCodePage; extern WCHAR wzUniBuf[]; /**************************************************************************/ struct LinePC { ULONG Line; ULONG Column; ULONG LineEnd; ULONG ColumnEnd; ULONG PC; ISymUnmanagedDocumentWriter* pWriter; }; typedef FIFO LinePCList; struct PInvokeDescriptor { mdModuleRef mrDll; char* szAlias; DWORD dwAttrs; }; struct TokenRelocDescr // for OBJ generation only! { DWORD offset; mdToken token; TokenRelocDescr(DWORD off, mdToken tk) { offset = off; token = tk; }; }; typedef FIFO TRDList; /* structure - element of [local] signature name list */ struct ARG_NAME_LIST { LPCUTF8 szName; //szName[1024]; DWORD dwName; BinStr* pSig; // argument's signature ptr BinStr* pMarshal; BinStr* pValue; int nNum; DWORD dwAttr; CustomDescrList CustDList; ARG_NAME_LIST *pNext; __forceinline ARG_NAME_LIST(int i, LPCUTF8 sz, BinStr *pbSig, BinStr *pbMarsh, DWORD attr) { nNum = i; //dwName = (DWORD)strlen(sz); //strcpy(szName,sz); szName = sz; dwName = (sz == NULL) ? 0 : (DWORD)strlen(sz); pNext = NULL; pSig=pbSig; pMarshal = pbMarsh; dwAttr = attr; pValue=NULL; }; inline ~ARG_NAME_LIST() { if(pSig) delete pSig; if(pMarshal) delete pMarshal; if(pValue) delete pValue; if(szName) delete [] szName; } }; class Scope; typedef FIFO ScopeList; class Scope { public: DWORD dwStart; DWORD dwEnd; ARG_NAME_LIST* pLocals; ScopeList SubScope; Scope* pSuperScope; Scope() { dwStart = dwEnd = 0; pLocals = NULL; pSuperScope = NULL; }; ~Scope() { Reset(); }; void Reset() { ARG_NAME_LIST* pNext; while(pLocals) { pNext = pLocals->pNext; delete pLocals; pLocals = pNext; } Scope* pS; while((pS = SubScope.POP()) != NULL) delete pS; pSuperScope = NULL; dwStart = dwEnd = 0; }; }; struct VarDescr { DWORD dwSlot; BinStr* pbsSig; BOOL bInScope; VarDescr() { dwSlot = (DWORD) -1; pbsSig = NULL; bInScope = FALSE; }; }; typedef FIFO VarDescrList; struct Label { //public: LPCUTF8 m_szName; DWORD m_PC; Label() :m_szName(NULL),m_PC(0){}; Label(LPCUTF8 pszName, DWORD PC):m_szName(pszName),m_PC(PC){}; ~Label(){ delete [] m_szName; }; int ComparedTo(Label* L) { return strcmp(m_szName,L->m_szName); }; //int Compare(char* L) { return strcmp(L,m_szName); }; LPCUTF8 NameOf() { return m_szName; }; }; //typedef SORTEDARRAY