object-introspection/oi
Jake Hillion a49f0e7410 codegenv2: improve multi argument generation (#395)
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
2023-10-31 10:22:56 -07:00
..
exporters capture_keys: include data in type path 2023-10-11 16:32:35 -07:00
support tomlplusplus: compile header once 2023-05-30 16:43:10 +02:00
type_graph codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
types/test move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
CMakeLists.txt containers: add required features (#374) 2023-10-09 17:50:39 -04:00
CodeGen.cpp codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
CodeGen.h codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
Config.cpp support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
Config.h support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
ContainerInfo.cpp containers: add required features (#374) 2023-10-09 17:50:39 -04:00
ContainerInfo.h containers: add required features (#374) 2023-10-09 17:50:39 -04:00
ContainerTypeEnum.h Implement Container V2 for std::unordered_multiset 2023-08-30 18:45:00 +02:00
Descs.cpp move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
Descs.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
DrgnUtils.cpp ensure oi_name is never a nullptr (#165) 2023-06-12 16:47:34 -07:00
DrgnUtils.h DrgnUtils: Add isSizeComplete and underlyingType helper functions 2023-05-24 15:57:18 +01:00
EnumBitset.h containers: add required features (#374) 2023-10-09 17:50:39 -04:00
Features.cpp oil v2 2023-08-23 15:59:53 +01:00
Features.h oil v2 2023-08-23 15:59:53 +01:00
FuncGen.cpp codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
FuncGen.h codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
Headers.h Compile Time OIL for OIL v2 2023-08-30 04:28:02 -07:00
IntrospectionResult.cpp tbv2: improve equality for iterator 2023-10-25 17:05:42 +01:00
Metrics.cpp move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
Metrics.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OICache.cpp add portability.h (#386) 2023-10-24 03:03:16 -07:00
OICache.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OICodeGen.cpp codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
OICodeGen.h remove oil v1 leftovers 2023-10-30 18:18:13 +00:00
OICompiler.cpp compiler: update to c++20 2023-10-25 15:55:18 +01:00
OICompiler.h compiler: update to c++20 2023-10-25 15:55:18 +01:00
OID.cpp remove oil v1 leftovers 2023-10-30 18:18:13 +00:00
OIDebugger.cpp add portability.h (#386) 2023-10-24 03:03:16 -07:00
OIDebugger.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OIGenerator.cpp codegenv2: improve multi argument generation (#395) 2023-10-31 10:22:56 -07:00
OIGenerator.h oilgen: accept multiple config files (#379) 2023-10-11 16:25:13 -07:00
OILexer.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OILexer.l move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OILibrary.cpp oil v2 2023-08-23 15:59:53 +01:00
OILibraryImpl.cpp support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
OILibraryImpl.h oil v2 2023-08-23 15:59:53 +01:00
OIOpts.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
OIParser.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
OIParser.yy move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OITraceCode.cpp Implement Container V2 for fbstring 2023-09-27 18:16:36 -07:00
PaddingHunter.cpp Add missing cstdint include 2023-09-22 10:59:23 +01:00
PaddingHunter.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
Portability.h add portability.h (#386) 2023-10-24 03:03:16 -07:00
Serialize.cpp move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
Serialize.h clean up common.h 2023-06-09 13:15:17 +02:00
SymbolService.cpp oil v2 2023-08-23 15:59:53 +01:00
SymbolService.h oil v2 2023-08-23 15:59:53 +01:00
Syscall.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
TimeUtils.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00
TrapInfo.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
TreeBuilder.cpp Implement Container V2 for std::unordered_multiset 2023-08-30 18:45:00 +02:00
TreeBuilder.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
TypeHierarchy.h clean up common.h 2023-06-09 13:15:17 +02:00
X86InstDefs.h move src directory to oi (#134) 2023-04-26 16:20:53 +01:00