object-introspection/oi
Jake Hillion db93feb180 incomplete: name type in compiler errors
Summary:

We have a good type representation in the Type Graph of an incomplete type and
the underlying type that represents. However, this incomplete type still ends
up in the generated code as `void` which loses information. For example, a
container that can't contain void may fail to compile because it was
initialised with `void` but really its because the type it was supposed to be
initialised with (say, `Foo`) had incomplete debug information.

This change identifies that a type is incomplete in the output by generating it
as an incomplete type `struct Incomplete<struct Foo>`. This allows us to name
the type correctly in the TreeBuilder output and filter for incomplete types,
as well as getting appropriate compiler errors if it mustn't be incomplete.

Test Plan:
- CI
- Added a unit test to namegen.
- Enabled and added an extra pointers_incomplete test.

This change is tricky to test because it isn't really user visible. The types
still use their `inputName` which is unchanged in any successful output - this
change is used so the compiler fails with a more detailed error.
2024-01-09 15:08:25 +00:00
..
exporters tbv2: calculate total memory footprint 2024-01-04 09:21:35 +00:00
support tomlplusplus: compile header once 2023-05-30 16:43:10 +02:00
type_graph incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
types/test move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
CMakeLists.txt tbv2: calculate total memory footprint 2024-01-04 09:21:35 +00:00
CodeGen.cpp incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
CodeGen.h oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08:00
Config.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
Config.h support 0 to many config files (#371) 2023-10-02 14:06:39 -06:00
ContainerInfo.cpp CodeGen v2: Enable independent running without CodeGen v1 2023-12-15 14:57:24 +00:00
ContainerInfo.h OICodeGen: Respect ContainerInfo::requiredFeatures 2023-11-16 18:11:14 +00: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 collapse TreeBuilderV2 features 2023-11-13 19:43:03 +00:00
Features.h collapse TreeBuilderV2 features 2023-11-13 19:43:03 +00:00
FuncGen.cpp tbv2: add dynamic context passed through all functions (#410) 2023-11-16 08:03:32 -08:00
FuncGen.h collapse TreeBuilderV2 features 2023-11-13 19:43:03 +00:00
Headers.h Compile Time OIL for OIL v2 2023-08-30 04:28:02 -07:00
IntrospectionResult.cpp capture_keys: store dynamic type path components more efficiently 2023-12-14 16:05:33 +00:00
Metrics.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00: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 Really, really make sure arrays have a name (#430) 2023-12-13 16:28:31 +00:00
OICodeGen.h remove oil v1 leftovers 2023-10-30 18:18:13 +00:00
OICompiler.cpp collapse TreeBuilderV2 features 2023-11-13 19:43:03 +00:00
OICompiler.h add range-v3 library 2023-11-13 18:42:04 +00:00
OID.cpp OID: Make CodeGen v2 (TypeGraph) the default 2023-12-14 17:42:03 +00:00
OIDebugger.cpp CodeGen v2: Enable independent running without CodeGen v1 2023-12-15 14:57:24 +00:00
OIDebugger.h jitlog: use a memfd and glog 2023-11-21 12:00:13 +00:00
OIGenerator.cpp oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08:00
OIGenerator.h oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08: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 collapse TreeBuilderV2 features 2023-11-13 19:43:03 +00: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 clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
OIParser.yy move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
OITraceCode.cpp incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
PaddingHunter.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00: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 Update drgn to Omar's branch 2023-12-13 11:59:21 +00:00
Serialize.h Update drgn to Omar's branch 2023-12-13 11:59:21 +00:00
SymbolService.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
SymbolService.h oil v2 2023-08-23 15:59:53 +01:00
Syscall.h jitlog: use a memfd and glog 2023-11-21 12:00:13 +00: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 clang-format: disable bin packing 2023-11-13 18:19:53 +00: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