Skip to content

Commit

Permalink
Add "_generated.*" suffix to some auto-generated files (#77083)
Browse files Browse the repository at this point in the history
* Add _generated.h to src\coreclr\jit\ICorJitInfo_API_names.h

* Add _generated.h to src\coreclr\jit\ICorJitInfo_API_wrapper.hpp

* renamed src\coreclr\tools\Common\JitInterface\CorInfoBase.cs

* fix ThunkGenerator (it used to insert two empty lines)

* CorInfoBase_generated.cs -> CorInfoImpl_generated.cs

* Drop _API_ part

* Rename icorjitinfo.cpp

* jitinterface.h -> _generated

Co-authored-by: Jan Kotas <[email protected]>
  • Loading branch information
EgorBo and jkotas authored Oct 16, 2022
1 parent 4a8c04c commit 9e7a8a1
Show file tree
Hide file tree
Showing 19 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/project/updating-jitinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There are several components that consume the JIT outside of the runtime. Since

The JitInterface is versioned by a GUID. Any change to JitInterface is required to update the JitInterface GUID located in jiteeversionguid.h (look for `JITEEVersionIdentifier`). Not doing so has consequences that are sometimes hard to debug.

If a method was added or modified in ICorStaticInfo or ICorDynamicInfo, port the change to src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt. Functions must be in the same order in ThunkInput.txt as they exist in corinfo.h and corjit.h. Run gen.bat or gen.sh to regenerate CorInfoBase.cs, jitinterface.h, ICorJitInfo_API_names.h, ICorJitInfo_API_wrapper.hpp, superpmi-shared\icorjitinfoimpl.h, superpmi-shim-counter\icorjitinfo.cpp, and superpmi-shim-simple\icorjitinfo.cpp from ThunkInput.txt. Provide a managed implementation of the method in CorInfoImpl.cs.
If a method was added or modified in ICorStaticInfo or ICorDynamicInfo, port the change to src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt. Functions must be in the same order in ThunkInput.txt as they exist in corinfo.h and corjit.h. Run gen.bat or gen.sh to regenerate all \*_generated.\* files from ThunkInput.txt. Provide a managed implementation of the method in CorInfoImpl.cs.

## Porting JitInterface changes to crossgen2

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ set( JIT_HEADERS
host.h
hostallocator.h
hwintrinsic.h
ICorJitInfo_API_names.h
ICorJitInfo_API_wrapper.hpp
ICorJitInfo_names_generated.h
ICorJitInfo_wrapper_generated.hpp
inline.h
inlinepolicy.h
instr.h
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7140,7 +7140,7 @@ struct WrapICorJitInfo : public ICorJitInfo
{
// If you get a build error here due to 'WrapICorJitInfo' being
// an abstract class, it's very likely that the wrapper bodies
// in ICorJitInfo_API_wrapper.hpp are no longer in sync with
// in ICorJitInfo_wrapper_generated.hpp are no longer in sync with
// the EE interface; please be kind and update the header file.
wrap = new (inst, jitstd::placement_t()) WrapICorJitInfo();

Expand All @@ -7160,7 +7160,7 @@ struct WrapICorJitInfo : public ICorJitInfo
COMP_HANDLE wrapHnd; // the "real thing"

public:
#include "ICorJitInfo_API_wrapper.hpp"
#include "ICorJitInfo_wrapper_generated.hpp"
};

#endif // MEASURE_CLRAPI_CALLS
Expand Down Expand Up @@ -8164,7 +8164,7 @@ void CompTimeSummaryInfo::Print(FILE* f)

static const char* APInames[] = {
#define DEF_CLR_API(name) #name,
#include "ICorJitInfo_API_names.h"
#include "ICorJitInfo_names_generated.h"
};

unsigned shownCalls = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ enum class PhaseDumps
enum API_ICorJitInfo_Names
{
#define DEF_CLR_API(name) API_##name,
#include "ICorJitInfo_API_names.h"
#include "ICorJitInfo_names_generated.h"
API_COUNT
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ private static IntPtr GetUnmanagedCallbacks()
return (IntPtr)callbacks;
}
}
}
");
}");
}

static void WriteNativeWrapperInterface(TextWriter tw, IEnumerable<FunctionDecl> functionData)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pushd %~dp0
call ..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h ..\..\..\..\jit\ICorJitInfo_API_names.h ..\..\..\..\jit\ICorJitInfo_API_wrapper.hpp ..\..\..\..\inc\icorjitinfoimpl_generated.h ..\..\..\..\tools\superpmi\superpmi-shim-counter\icorjitinfo.cpp ..\..\..\..\tools\superpmi\superpmi-shim-simple\icorjitinfo.cpp
call ..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoImpl_generated.cs ..\..\..\aot\jitinterface\jitinterface_generated.h ..\..\..\..\jit\ICorJitInfo_names_generated.h ..\..\..\..\jit\ICorJitInfo_wrapper_generated.hpp ..\..\..\..\inc\icorjitinfoimpl_generated.h ..\..\..\..\tools\superpmi\superpmi-shim-counter\icorjitinfo_generated.cpp ..\..\..\..\tools\superpmi\superpmi-shim-simple\icorjitinfo_generated.cpp
call ..\..\..\..\..\..\dotnet.cmd run -- InstructionSetGenerator InstructionSetDesc.txt ..\..\Internal\Runtime\ReadyToRunInstructionSet.cs ..\..\Internal\Runtime\ReadyToRunInstructionSetHelper.cs ..\CorInfoInstructionSet.cs ..\..\..\..\inc\corinfoinstructionset.h ..\..\..\..\inc\readytoruninstructionset.h
popd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
cd "$(dirname ${BASH_SOURCE[0]})"
../../../../../../dotnet.sh run -- ThunkInput.txt ../CorInfoBase.cs ../../../aot/jitinterface/jitinterface.h ../../../../jit/ICorJitInfo_API_names.h ../../../../jit/ICorJitInfo_API_wrapper.hpp ../../../../inc/icorjitinfoimpl_generated.h ../../../../tools/superpmi/superpmi-shim-counter/icorjitinfo.cpp ../../../../tools/superpmi/superpmi-shim-simple/icorjitinfo.cpp
../../../../../../dotnet.sh run -- ThunkInput.txt ../CorInfoImpl_generated.cs ../../../aot/jitinterface/jitinterface_generated.h ../../../../jit/ICorJitInfo_names_generated.h ../../../../jit/ICorJitInfo_wrapper_generated.hpp ../../../../inc/icorjitinfoimpl_generated.h ../../../../tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp ../../../../tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp
../../../../../../dotnet.sh run -- InstructionSetGenerator InstructionSetDesc.txt ../../Internal/Runtime/ReadyToRunInstructionSet.cs ../../Internal/Runtime/ReadyToRunInstructionSetHelper.cs ../CorInfoInstructionSet.cs ../../../../inc/corinfoinstructionset.h ../../../../inc/readytoruninstructionset.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@
<Compile Include="..\..\Common\JitInterface\TypeString.cs">
<Link>JitInterface\TypeString.cs</Link>
</Compile>
<Compile Include="..\..\Common\JitInterface\CorInfoBase.cs">
<Link>JitInterface\CorInfoBase.cs</Link>
<Compile Include="..\..\Common\JitInterface\CorInfoImpl_generated.cs">
<Link>JitInterface\CorInfoImpl_generated.cs</Link>
</Compile>
<Compile Include="..\..\Common\JitInterface\CorInfoImpl.cs">
<Link>JitInterface\CorInfoImpl.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<Compile Include="..\..\Common\JitInterface\TypeString.cs">
<Link>JitInterface\TypeString.cs</Link>
</Compile>
<Compile Include="..\..\Common\JitInterface\CorInfoBase.cs">
<Link>JitInterface\CorInfoBase.cs</Link>
<Compile Include="..\..\Common\JitInterface\CorInfoImpl_generated.cs">
<Link>JitInterface\CorInfoImpl_generated.cs</Link>
</Compile>
<Compile Include="..\..\Common\JitInterface\CorInfoImpl.cs">
<Link>JitInterface\CorInfoImpl.cs</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/aot/jitinterface/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdint.h>

#include "dllexport.h"
#include "jitinterface.h"
#include "jitinterface_generated.h"

static void NotImplemented()
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/aot/jitinterface/jitwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdint.h>

#include "dllexport.h"
#include "jitinterface.h"
#include "jitinterface_generated.h"

DLL_EXPORT int JitCompileMethod(
CorInfoExceptionClass **ppException,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include_directories(../superpmi-shared)
set(SUPERPMI_SHIM_COUNTER_SOURCES
jithost.cpp
icorjitcompiler.cpp
icorjitinfo.cpp
icorjitinfo_generated.cpp
methodcallsummarizer.cpp
superpmi-shim-counter.cpp
../superpmi-shared/callutils.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include_directories(../superpmi-shared)
set(SUPERPMI_SHIM_SIMPLE_SOURCES
jithost.cpp
icorjitcompiler.cpp
icorjitinfo.cpp
icorjitinfo_generated.cpp
superpmi-shim-simple.cpp
../superpmi-shared/callutils.cpp
../superpmi-shared/compileresult.cpp
Expand Down

0 comments on commit 9e7a8a1

Please sign in to comment.