Commit Graph

468 Commits

Author SHA1 Message Date
Jay Kamat
4308155c0e Tweak social media previews for Oid website 2023-09-05 20:01:42 +01:00
Thierry Treyer
a5284549da Implement Container V2 for std::shared_ptr 2023-08-31 20:07:32 +02:00
Thierry Treyer
344023239b Add OILv2 tests for std::optional 2023-08-31 20:07:32 +02:00
Jake Hillion
a95d6f2187 add support for std::optional in treebuilder v2 2023-08-31 20:07:32 +02:00
Thierry Treyer
2699b4a665 Implement Container V2 for std::unique_ptr 2023-08-31 20:07:32 +02:00
Thierry Treyer
36452a2471 Fix double parseVarint for ParsedData::Sum 2023-08-30 21:17:19 +02:00
Thierry Treyer
deb7dcdf1c Implement Container V2 for std::unordered_multiset 2023-08-30 18:45:00 +02:00
Thierry Treyer
54e01cfe27 Implement Container V2 for std::unordered_multimap 2023-08-30 18:45:00 +02:00
Thierry Treyer
7bdf72ec58 Implement Container V2 for std::unordered_map 2023-08-30 18:45:00 +02:00
Thierry Treyer
c1f322dc42 Implement Container V2 for std::unordered_set 2023-08-30 18:45:00 +02:00
Jake Hillion
5b674fd74c json: fix indentation of last } 2023-08-30 13:09:05 +01:00
Jake Hillion
a9cffbe22d Compile Time OIL for OIL v2
Summary:
Update `OIGenerator` and out BUCK stuff for compile time OIL with OIL v2. Main things:
- Switch `OIGenerator` from the `getObjectSize` call to the new `introspect` call.
- Switch from looking at template parameters to looking at function parameters, as this was exposing a bug in our elfutils/drgn and this way it's the same as OID.
- Migrate `OIGenerator` to CodeGen v2 and update CodeGen v2 to accept a linkage name.
- Update the compile time example to be the same as the JIT example, using the new interface and the JSON exporter.
- Clean up the `ObjectIntrospection.h` header.

Differential Revision: D48687728

fbshipit-source-id: 2c3c041fd1b6499c5e02eb5e2082a977bfa529d7
2023-08-30 04:28:02 -07:00
Jake Hillion
6b90401f51 tbv2: add make_field helper 2023-08-29 17:41:10 +01:00
Jake Hillion
d009f02ecb name contained types properly in treebuilder v2
Types within containers were previously named TODO. This sorts it out so
they're named as their most resolved type. The current implementation
skips Typedef names.
2023-08-25 16:25:14 +01:00
Thierry Treyer
1459433a50 Implement Container V2 for std::multiset 2023-08-25 16:07:10 +02:00
Thierry Treyer
f9b4d65cd8 Implement Container V2 for std::multimap 2023-08-25 16:07:10 +02:00
Thierry Treyer
5117482596 Update std::set container with static element_size 2023-08-25 15:13:55 +02:00
Thierry Treyer
19222a4fe2 Implement Container V2 for std::map 2023-08-25 15:13:55 +02:00
Jake Hillion
54c8d79996 oil: fix verbosity level in jit oil 2023-08-24 17:39:12 +01:00
Jake Hillion
2bf1dd8b60 Update internal build for oil v2 2023-08-24 15:16:52 +01:00
Alastair Robertson
03429f3da9 TypeGraph: Remove NodeTracker from the TypeGraph class
The TypeGraph class should only be responsible for storing Type nodes.
Traversing the graph and tracking which nodes have been visited should
not be included there.

Passes now take a NodeTrackerHolder as an input parameter, which
provides access to a zeroed-out NodeTracker.
2023-08-24 15:01:45 +01:00
Thierry Treyer
b8cb81e366 std::set implementation for Container V2 2023-08-24 13:57:27 +02:00
Jake Hillion
5071519e45 oil v2 2023-08-23 15:59:53 +01:00
Jake Hillion
57210cf06c features: allow hidden options to have no help entry 2023-08-23 15:59:53 +01:00
Thierry Treyer
e60d06a321 Fix JIT CodeGen for Try<> 2023-08-21 19:16:13 +02:00
Jake Hillion
c2a1728072 remove dependency on <type_traits> 2023-08-21 14:38:45 +01:00
Jake Hillion
c62fbe371d type_graph: provide inputName for all types
Type Graph deduplicates and modifies names to better fit the generated
code, for example `int32_t[4]` becomes `OIArray<int32_t, 4>` and `struct
MyStruct` might become `struct MyStruct_0`.

Add an `inputName` which better represents the original input code which
can be used when building the tree.
2023-08-18 16:58:21 +01:00
Alastair Robertson
373dbe8f6c TypeGraph: Add option to record enumerator names 2023-08-17 15:47:23 +01:00
Jake Hillion
a2f7462a5d DrgnParser: store type of template param value 2023-08-17 15:40:34 +01:00
Thierry Treyer
ca0c71fa40
Workaround for #289 missing symbol (#290) 2023-08-17 13:53:14 +01:00
Jake Hillion
063646a1d9 codegen: split genClassTypeHandler 2023-08-16 14:40:07 +01:00
Alastair Robertson
ff31971bd3 Printer: Use NodeIds for stable IDs when printing graphs
This removes Printer's legacy behaviour of generating an ID for each
node as it gets printed. This old method meant that if new nodes were
added to or removed from a graph, every ID after the new/removed node
would change.

Now IDs are stable so it is easier to follow specific nodes through
multiple transformation passes in CodeGen.
2023-08-16 12:19:14 +01:00
Alastair Robertson
dca99fc4ad TypeGraph: Change Type::name() to return a reference instead of a copy
Names which were generated on-demand are now stored in member variables,
which are set during the ctor and can be regenerated when required (by
NameGen).
2023-08-15 15:33:21 +01:00
Alastair Robertson
57d2f3d380 DrgnParser: Don't error out for certain bad DWARF
Match the behaviour of CodeGen v1 and just log warnings when certain
debug info has issues.
2023-08-14 16:22:57 +01:00
Alastair Robertson
97ba03620a TypeGraph: Convert unit tests relying on Printer to use TypeGraphParser 2023-08-14 15:01:09 +01:00
Alastair Robertson
e5a83a3a37 TopoSorterTest: Add test for value template params 2023-08-11 10:50:33 +01:00
Jake Hillion
3a2cef0372 features: centralise requirement logic
This has room for conflicting features in future which will be used with
the OIL implementation. For now it makes it much easier to add
requirements.
2023-08-09 15:23:12 +01:00
dependabot[bot]
2d32a30bb9 Bump word-wrap from 1.2.3 to 1.2.5 in /website
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-03 18:00:16 +01:00
dependabot[bot]
ecff9f025f Bump semver from 5.7.1 to 5.7.2 in /website
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-03 17:42:04 +01:00
Alastair Robertson
8f3d11955c OIRP: Add copyright header 2023-08-03 15:17:16 +01:00
Alastair Robertson
d45c7f4931 Flattener: Handle incomplete parent types 2023-08-02 14:29:19 +01:00
Alastair Robertson
0612159121 AlignmentCalc: Mark as packed if members are not aligned
We previously only marked as packed if there was no tail padding, which
was not a sufficient condition.

The new AlignmentCalcTest.PackedMembers test case is an example which
would previously not have been marked as packed.
2023-08-02 12:07:52 +01:00
Alastair Robertson
ececbe0a99 TopoSorter: Sort contained types after unique_ptr and shared_ptr
This is the same handling as regular pointers have. I came across a
type-cycle with unique_ptrs where this was necessary.
2023-08-01 17:53:39 +01:00
Alastair Robertson
e9975286b2 NameGen: Fix naming of const pointers 2023-08-01 17:53:39 +01:00
Alastair Robertson
ed2c6f357d CodeGen: Apply "alignas" to all stubbed types
Stubbing types listed in OICodeGen's "typesToStub" leaves them in the
same state as stubbed unions, so they need the same handling.
2023-08-01 17:53:39 +01:00
Alastair Robertson
6d30015764 TypeGraph: Set alignment for Thrift isset container to 1 2023-08-01 17:48:44 +01:00
Alastair Robertson
79d1d55b03 CI: Set installs to noninteractive so they don't hang waiting for user input 2023-08-01 17:30:38 +01:00
Alastair Robertson
6fbb60826f
EnforceCompatibility: Stub out void pointers
CodeGen v1 does not record anything for pointers to incomplete types.
Not even the address, as is done for other pointers.

Introduce a new Primitive type "Incomplete". This behaves identically to
"Void", but allows us to tell whether a type was defined as void or if
it ended up like that because of incomplete DWARF information.
2023-07-31 14:28:05 +01:00
Alastair Robertson
7bb6791af9 AddPadding: Insert padding at the beginning of structs if necessary
This is sometimes needed now that we're removing members before adding
padding.
2023-07-27 16:01:35 +01:00
Jake Hillion
d7cfcca30d move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00