/// (e.g. in a cache).
///
/// Buffer callbacks must be thread safe.
-typedef std::function<void(unsigned Task, std::unique_ptr<MemoryBuffer> MB)>
- AddBufferFn;
+using AddBufferFn =
+ std::function<void(unsigned Task, std::unique_ptr<MemoryBuffer> MB)>;
/// Create a local file system cache which uses the given cache directory and
/// file callback. This function also creates the cache directory if it does not
///
/// Note that in out-of-process backend scenarios, none of the hooks will be
/// called for ThinLTO tasks.
- typedef std::function<bool(unsigned Task, const Module &)> ModuleHookFn;
+ using ModuleHookFn = std::function<bool(unsigned Task, const Module &)>;
/// This module hook is called after linking (regular LTO) or loading
/// (ThinLTO) the module, before modifying it.
///
/// It is called regardless of whether the backend is in-process, although it
/// is not called from individual backend processes.
- typedef std::function<bool(const ModuleSummaryIndex &Index)>
- CombinedIndexHookFn;
+ using CombinedIndexHookFn =
+ std::function<bool(const ModuleSummaryIndex &Index)>;
CombinedIndexHookFn CombinedIndexHook;
/// This is a convenience function that configures this Config object to write
/// the fly.
///
/// Stream callbacks must be thread safe.
-typedef std::function<std::unique_ptr<NativeObjectStream>(unsigned Task)>
- AddStreamFn;
+using AddStreamFn =
+ std::function<std::unique_ptr<NativeObjectStream>(unsigned Task)>;
/// This is the type of a native object cache. To request an item from the
/// cache, pass a unique string as the Key. For hits, the cached file will be
///
/// if (AddStreamFn AddStream = Cache(Task, Key))
/// ProduceContent(AddStream);
-typedef std::function<AddStreamFn(unsigned Task, StringRef Key)>
- NativeObjectCache;
+using NativeObjectCache =
+ std::function<AddStreamFn(unsigned Task, StringRef Key)>;
/// A ThinBackend defines what happens after the thin-link phase during ThinLTO.
/// The details of this type definition aren't important; clients can only
/// create a ThinBackend using one of the create*ThinBackend() functions below.
-typedef std::function<std::unique_ptr<ThinBackendProc>(
+using ThinBackend = std::function<std::unique_ptr<ThinBackendProc>(
Config &C, ModuleSummaryIndex &CombinedIndex,
StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
- AddStreamFn AddStream, NativeObjectCache Cache)>
- ThinBackend;
+ AddStreamFn AddStream, NativeObjectCache Cache)>;
/// This ThinBackend runs the individual backend jobs in-process.
ThinBackend createInProcessThinBackend(unsigned ParallelismLevel);