This is an archive of the discontinued LLVM Phabricator instance.

[Support] Add OpauqeDataStore
AbandonedPublic

Authored by beanz on Mar 24 2022, 1:54 PM.

Details

Reviewers
None
Summary

There are places in LLVM where data needs to be communicated between
layers that lack a good place to store the data. This leads to leaky
abstractions, or sometimes just using void*.

This data type can provide a type-safe alternative. The OpaqueDataStore
stores elements by type and can regurgitate them on demand. The object
holding the OpaqueDataStore requires no visibility to the types stored
within it, the classes for the stored data are only required to be
available at the points where the data is accessed.

I intend to use this in a subsequent patch to attach data to the
LLVMContext from inside the DirectX backend. The data being attached
should have the same lifetime as the LLVMContext, does not invalidate
(unless the context is destroyed), and should not be part of the IR
library.

Diff Detail

Event Timeline

beanz created this revision.Mar 24 2022, 1:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 1:54 PM
beanz requested review of this revision.Mar 24 2022, 1:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 1:54 PM
beanz abandoned this revision.Mar 24 2022, 2:17 PM

Somehow accidentally uploaded this twice :(