mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
a49f0e7410
Summary: Adds a new function `CodeGen::codegenFromDrgns` which runs multiple drgn root types through one `DrgnParser`. Stores the naming for the output within this function as we previously decided that when doing the actual codegen, which is too late with multiple root types. This new function is used in `OIGenerator` when you have multiple OIL calls within one input object. Rather than producing separate `.o`s with likely duplicate code for each callsite, we produce a single `.o` that contains both calls. For calls with types with significant overlap this should be a significant reduction in work. The downside is the calls can't have different features, but this could be solved in the future by namespacing the code based on features/config within the generated `.cpp` - the pros seem to outweigh the con. This should also be used with `oid` in multi probe mode as it would again significantly reduce the work it has to do. I didn't do this yet as it requires changing the cache. As I've got a big refactor cache ongoing at the minute it makes sense to wait until after that's landed to make this change. Test Plan: Generally tested with GitHub CI. Tested the new multi call OILGen with the new example seen below. Outputs the following code with two root calls: P869569859 - note that `VectorOfStrings_0` is the only instance, whereas previously we'd have generated it in two files. Differential Revision: D50835153 Pulled By: JakeHillion |
||
---|---|---|
.. | ||
exporters | ||
support | ||
type_graph | ||
types/test | ||
CMakeLists.txt | ||
CodeGen.cpp | ||
CodeGen.h | ||
Config.cpp | ||
Config.h | ||
ContainerInfo.cpp | ||
ContainerInfo.h | ||
ContainerTypeEnum.h | ||
Descs.cpp | ||
Descs.h | ||
DrgnUtils.cpp | ||
DrgnUtils.h | ||
EnumBitset.h | ||
Features.cpp | ||
Features.h | ||
FuncGen.cpp | ||
FuncGen.h | ||
Headers.h | ||
IntrospectionResult.cpp | ||
Metrics.cpp | ||
Metrics.h | ||
OICache.cpp | ||
OICache.h | ||
OICodeGen.cpp | ||
OICodeGen.h | ||
OICompiler.cpp | ||
OICompiler.h | ||
OID.cpp | ||
OIDebugger.cpp | ||
OIDebugger.h | ||
OIGenerator.cpp | ||
OIGenerator.h | ||
OILexer.h | ||
OILexer.l | ||
OILibrary.cpp | ||
OILibraryImpl.cpp | ||
OILibraryImpl.h | ||
OIOpts.h | ||
OIParser.h | ||
OIParser.yy | ||
OITraceCode.cpp | ||
PaddingHunter.cpp | ||
PaddingHunter.h | ||
Portability.h | ||
Serialize.cpp | ||
Serialize.h | ||
SymbolService.cpp | ||
SymbolService.h | ||
Syscall.h | ||
TimeUtils.h | ||
TrapInfo.h | ||
TreeBuilder.cpp | ||
TreeBuilder.h | ||
TypeHierarchy.h | ||
X86InstDefs.h |