Skip to content

Commit

Permalink
Exclude unnecessary functions/fields when FEATURE_METADATA_EMIT_IN_DE…
Browse files Browse the repository at this point in the history
…BUGGER (#78058)
  • Loading branch information
elinor-fung authored Nov 9, 2022
1 parent 0c22bc2 commit fdec920
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/coreclr/md/compiler/custattr_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ STDMETHODIMP RegMeta::SetCustomAttributeValue( // Return code.
#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
} // RegMeta::SetCustomAttributeValue

#if !defined(FEATURE_METADATA_EMIT_IN_DEBUGGER)
//*****************************************************************************
//*****************************************************************************
HRESULT RegMeta::_IsKnownCustomAttribute( // S_OK, S_FALSE, or error.
Expand Down Expand Up @@ -1988,4 +1989,6 @@ HRESULT RegMeta::_HandleNativeTypeCustomAttribute(// S_OK or error.
#pragma warning(pop)
#endif

#endif // !FEATURE_METADATA_EMIT_IN_DEBUGGER

#endif //FEATURE_METADATA_EMIT
6 changes: 2 additions & 4 deletions src/coreclr/md/compiler/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,11 @@ STDMETHODIMP RegMeta::DefineModuleRef( // S_OK or error.
#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
} // RegMeta::DefineModuleRef

#if !defined(FEATURE_METADATA_EMIT_IN_DEBUGGER)
HRESULT RegMeta::_DefineModuleRef( // S_OK or error.
LPCWSTR szName, // [IN] DLL name
mdModuleRef *pmur) // [OUT] returned module ref token
{
#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
return E_NOTIMPL;
#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
HRESULT hr = S_OK;
ModuleRefRec *pModuleRef = 0; // The ModuleRef record.
RID iModuleRef; // Rid of new ModuleRef record.
Expand Down Expand Up @@ -1287,8 +1285,8 @@ HRESULT RegMeta::_DefineModuleRef( // S_OK or error.
ErrExit:

return hr;
#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
} // RegMeta::_DefineModuleRef
#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER

//*****************************************************************************
// Set the parent for the specified MemberRef.
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/md/compiler/regmeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,7 @@ class RegMeta :
PCCOR_SIGNATURE pvNativeType, // [IN] native type specification
ULONG cbNativeType); // [IN] count of bytes of pvNativeType

#if !defined(FEATURE_METADATA_EMIT_IN_DEBUGGER)
HRESULT _IsKnownCustomAttribute( // S_OK, S_FALSE, or error.
mdToken tkType, // [IN] Token of custom attribute's type.
int *pca); // [OUT] Put value from KnownCustAttr enum here.
Expand All @@ -1833,6 +1834,7 @@ class RegMeta :
CaArg *pArgs, // Pointer to args.
CaNamedArg *pNamedArgs, // Pointer to named args.
CQuickArray<BYTE> &qNativeType); // Native type is built here.
#endif // !FEATURE_METADATA_EMIT_IN_DEBUGGER

// Find a given param of a Method.
HRESULT _FindParamOfMethod( // S_OK or error.
Expand Down Expand Up @@ -2040,7 +2042,10 @@ class RegMeta :
SetAPICallerType m_SetAPICaller;

CorValidatorModuleType m_ModuleType;

#if !defined(FEATURE_METADATA_EMIT_IN_DEBUGGER)
SHash<CustAttrHashTraits> m_caHash; // Hashed list of custom attribute types seen.
#endif

bool m_bKeepKnownCa; // Should all known CA's be kept?

Expand Down

0 comments on commit fdec920

Please sign in to comment.