Skip to content

Commit

Permalink
Remove empty BEGIN/END_ENTRYPOINT_* macros (#77810)
Browse files Browse the repository at this point in the history
  • Loading branch information
elinor-fung authored Nov 3, 2022
1 parent 5d0943f commit 92971c9
Show file tree
Hide file tree
Showing 36 changed files with 47 additions and 1,125 deletions.
41 changes: 5 additions & 36 deletions src/coreclr/dlls/mscoree/mscoree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ STDAPI DLLEXPORT MetaDataGetDispenser( // Return HRESULT

NonVMComHolder<IClassFactory> pcf(NULL);
HRESULT hr;
BEGIN_ENTRYPOINT_NOTHROW;

IfFailGo(MetaDataDllGetClassObject(rclsid, IID_IClassFactory, (void **) &pcf));
hr = pcf->CreateInstance(NULL, riid, ppv);

ErrExit:
END_ENTRYPOINT_NOTHROW;

return (hr);
}

Expand All @@ -96,13 +93,7 @@ STDAPI DLLEXPORT GetMetaDataInternalInterface(
PRECONDITION(CheckPointer(ppv));
} CONTRACTL_END;

HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

hr = GetMDInternalInterface(pData, cbData, flags, riid, ppv);

END_ENTRYPOINT_NOTHROW;
return hr;
return GetMDInternalInterface(pData, cbData, flags, riid, ppv);
}

// ---------------------------------------------------------------------------
Expand All @@ -123,13 +114,7 @@ STDAPI DLLEXPORT GetMetaDataInternalInterfaceFromPublic(
PRECONDITION(CheckPointer(ppv));
} CONTRACTL_END;

HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

hr = GetMDInternalInterfaceFromPublic(pv, riid, ppv);

END_ENTRYPOINT_NOTHROW;
return hr;
return GetMDInternalInterfaceFromPublic(pv, riid, ppv);
}

// ---------------------------------------------------------------------------
Expand All @@ -150,13 +135,7 @@ STDAPI DLLEXPORT GetMetaDataPublicInterfaceFromInternal(
ENTRY_POINT;
} CONTRACTL_END;

HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

hr = GetMDPublicInterfaceFromInternal(pv, riid, ppv);

END_ENTRYPOINT_NOTHROW;
return hr;
return GetMDPublicInterfaceFromInternal(pv, riid, ppv);
}


Expand All @@ -178,12 +157,7 @@ STDAPI ReOpenMetaDataWithMemory(
PRECONDITION(CheckPointer(pData));
} CONTRACTL_END;

HRESULT hr = S_OK;

BEGIN_ENTRYPOINT_NOTHROW;
hr = MDReOpenMetaDataWithMemory(pUnk, pData, cbData);
END_ENTRYPOINT_NOTHROW;
return hr;
return MDReOpenMetaDataWithMemory(pUnk, pData, cbData);
}

// ---------------------------------------------------------------------------
Expand All @@ -205,12 +179,7 @@ STDAPI ReOpenMetaDataWithMemoryEx(
PRECONDITION(CheckPointer(pData));
} CONTRACTL_END;

HRESULT hr = S_OK;

BEGIN_ENTRYPOINT_NOTHROW;
hr = MDReOpenMetaDataWithMemoryEx(pUnk, pData, cbData, dwReOpenFlags);
END_ENTRYPOINT_NOTHROW;
return hr;
return MDReOpenMetaDataWithMemoryEx(pUnk, pData, cbData, dwReOpenFlags);
}

static DWORD g_dwSystemDirectory = 0;
Expand Down
28 changes: 0 additions & 28 deletions src/coreclr/inc/entrypoints.h

This file was deleted.

1 change: 0 additions & 1 deletion src/coreclr/inc/ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "corerror.h"
#include "stresslog.h"
#include "staticcontract.h"
#include "entrypoints.h"

#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)
#define _DEBUG_IMPL 1
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/utilcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#endif

#include "contract.h"
#include "entrypoints.h"

#include<minipal/utils.h>

Expand Down
54 changes: 2 additions & 52 deletions src/coreclr/md/ceefilegen/cceegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,24 @@ STDMETHODIMP CCeeGen::SetInitialGrowth(DWORD growth)
STDMETHODIMP CCeeGen::EmitString (_In_ LPWSTR lpString, ULONG *RVA)
{
HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

if (! RVA)
IfFailGo(E_POINTER);
hr = getStringSection().getEmittedStringRef(lpString, RVA);
ErrExit:

END_ENTRYPOINT_NOTHROW;
return hr;
}

STDMETHODIMP CCeeGen::GetString(ULONG RVA, __inout LPWSTR *lpString)
{
HRESULT hr = E_FAIL;
BEGIN_ENTRYPOINT_NOTHROW;

if (! lpString)
IfFailGo(E_POINTER);
*lpString = (LPWSTR)getStringSection().computePointer(RVA);


ErrExit:

END_ENTRYPOINT_NOTHROW;
if (*lpString)
return S_OK;
return hr;
Expand All @@ -133,7 +127,6 @@ STDMETHODIMP CCeeGen::GetString(ULONG RVA, __inout LPWSTR *lpString)
STDMETHODIMP CCeeGen::AllocateMethodBuffer(ULONG cchBuffer, UCHAR **lpBuffer, ULONG *RVA)
{
HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

ULONG methodOffset = 0;

Expand All @@ -152,24 +145,19 @@ STDMETHODIMP CCeeGen::AllocateMethodBuffer(ULONG cchBuffer, UCHAR **lpBuffer, UL
*RVA = methodOffset;

ErrExit:
END_ENTRYPOINT_NOTHROW;

return hr;
}

STDMETHODIMP CCeeGen::GetMethodBuffer(ULONG RVA, UCHAR **lpBuffer)
{
HRESULT hr = E_FAIL;
BEGIN_ENTRYPOINT_NOTHROW;

if (! lpBuffer)
IfFailGo(E_POINTER);
*lpBuffer = (UCHAR*)getIlSection().computePointer(RVA);


ErrExit:
END_ENTRYPOINT_NOTHROW;

if (lpBuffer != NULL && *lpBuffer != 0)
return S_OK;

Expand All @@ -179,15 +167,12 @@ STDMETHODIMP CCeeGen::GetMethodBuffer(ULONG RVA, UCHAR **lpBuffer)
STDMETHODIMP CCeeGen::ComputePointer(HCEESECTION section, ULONG RVA, UCHAR **lpBuffer)
{
HRESULT hr = E_FAIL;
BEGIN_ENTRYPOINT_NOTHROW;

if (! lpBuffer)
IfFailGo(E_POINTER);
*lpBuffer = (UCHAR*) ((CeeSection *)section)->computePointer(RVA);

ErrExit:
END_ENTRYPOINT_NOTHROW;

if (lpBuffer != NULL && *lpBuffer != 0)
return S_OK;
return hr;
Expand All @@ -196,52 +181,33 @@ STDMETHODIMP CCeeGen::ComputePointer(HCEESECTION section, ULONG RVA, UCHAR **lpB
STDMETHODIMP CCeeGen::GetIMapTokenIface (
IUnknown **pIMapToken)
{
BEGIN_ENTRYPOINT_NOTHROW;

_ASSERTE(!"E_NOTIMPL");
END_ENTRYPOINT_NOTHROW;

return E_NOTIMPL;
}

STDMETHODIMP CCeeGen::AddNotificationHandler (
IUnknown *pHandler)
{
BEGIN_ENTRYPOINT_NOTHROW;
_ASSERTE(!"E_NOTIMPL");
END_ENTRYPOINT_NOTHROW;

return E_NOTIMPL;
}

STDMETHODIMP CCeeGen::GenerateCeeFile ()
{
BEGIN_ENTRYPOINT_NOTHROW;

_ASSERTE(!"E_NOTIMPL");
END_ENTRYPOINT_NOTHROW;

return E_NOTIMPL;
}

STDMETHODIMP CCeeGen::GetIlSection (
HCEESECTION *section)
{
BEGIN_ENTRYPOINT_NOTHROW;

*section = (HCEESECTION)(m_sections[m_ilIdx]);
END_ENTRYPOINT_NOTHROW;

return S_OK;
}

STDMETHODIMP CCeeGen::GetStringSection(HCEESECTION *section)
{
BEGIN_ENTRYPOINT_NOTHROW;

_ASSERTE(!"E_NOTIMPL");
END_ENTRYPOINT_NOTHROW;

return E_NOTIMPL;
}

Expand All @@ -251,37 +217,24 @@ STDMETHODIMP CCeeGen::AddSectionReloc (
HCEESECTION relativeTo,
CeeSectionRelocType relocType)
{
HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

hr = m_sections[m_ilIdx]->addSectReloc(offset, *(m_sections[m_ilIdx]), relocType);
END_ENTRYPOINT_NOTHROW;
return hr;
return m_sections[m_ilIdx]->addSectReloc(offset, *(m_sections[m_ilIdx]), relocType);
}

STDMETHODIMP CCeeGen::GetSectionCreate (
const char *name,
DWORD flags,
HCEESECTION *section)
{
HRESULT hr = S_OK;
BEGIN_ENTRYPOINT_NOTHROW;

short sectionIdx;
hr = getSectionCreate (name, flags, (CeeSection **)section, &sectionIdx);
END_ENTRYPOINT_NOTHROW;
return hr;
return getSectionCreate (name, flags, (CeeSection **)section, &sectionIdx);
}

STDMETHODIMP CCeeGen::GetSectionDataLen (
HCEESECTION section,
ULONG *dataLen)
{
BEGIN_ENTRYPOINT_NOTHROW;

CeeSection *pSection = (CeeSection*) section;
*dataLen = pSection->dataLen();
END_ENTRYPOINT_NOTHROW;

return NOERROR;
}
Expand All @@ -292,11 +245,8 @@ STDMETHODIMP CCeeGen::GetSectionBlock (
ULONG align,
void **ppBytes)
{
BEGIN_ENTRYPOINT_NOTHROW;

CeeSection *pSection = (CeeSection*) section;
*ppBytes = (BYTE *)pSection->getBlock(len, align);
END_ENTRYPOINT_NOTHROW;

if (*ppBytes == 0)
return E_OUTOFMEMORY;
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/md/ceefilegen/ceegentokenmapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ HRESULT STDMETHODCALLTYPE CeeGenTokenMapper::Map(
ULONG ridFrom = 0;
TOKENMAP *pMap = NULL;

BEGIN_ENTRYPOINT_NOTHROW;

if ( IndexForType(tkFrom) == -1 )
{
// It is a type that we are not tracking, such as mdtProperty or mdtEvent,
Expand Down Expand Up @@ -89,8 +87,6 @@ HRESULT STDMETHODCALLTYPE CeeGenTokenMapper::Map(
*pToken = tkTo;

ErrExit:
END_ENTRYPOINT_NOTHROW;

return hr;
}

Expand Down
Loading

0 comments on commit 92971c9

Please sign in to comment.