From: Fangrui Song Date: Thu, 2 May 2019 10:52:34 +0000 (+0000) Subject: [LTO] Migrate typedef to using X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d21e156553abaccbcf8b2fd41672debcb93d2d9;p=llvm [LTO] Migrate typedef to using using has been used in several places in the file. Migrate the rest for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359776 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/LTO/Caching.h b/include/llvm/LTO/Caching.h index c20d8192083..4c4a708d24e 100644 --- a/include/llvm/LTO/Caching.h +++ b/include/llvm/LTO/Caching.h @@ -24,8 +24,8 @@ namespace lto { /// (e.g. in a cache). /// /// Buffer callbacks must be thread safe. -typedef std::function MB)> - AddBufferFn; +using AddBufferFn = + std::function 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 diff --git a/include/llvm/LTO/Config.h b/include/llvm/LTO/Config.h index 1e2eeab11c0..6db722d2133 100644 --- a/include/llvm/LTO/Config.h +++ b/include/llvm/LTO/Config.h @@ -141,7 +141,7 @@ struct Config { /// /// Note that in out-of-process backend scenarios, none of the hooks will be /// called for ThinLTO tasks. - typedef std::function ModuleHookFn; + using ModuleHookFn = std::function; /// This module hook is called after linking (regular LTO) or loading /// (ThinLTO) the module, before modifying it. @@ -174,8 +174,8 @@ struct Config { /// /// It is called regardless of whether the backend is in-process, although it /// is not called from individual backend processes. - typedef std::function - CombinedIndexHookFn; + using CombinedIndexHookFn = + std::function; CombinedIndexHookFn CombinedIndexHook; /// This is a convenience function that configures this Config object to write diff --git a/include/llvm/LTO/LTO.h b/include/llvm/LTO/LTO.h index 8fcf1075721..489561e8c82 100644 --- a/include/llvm/LTO/LTO.h +++ b/include/llvm/LTO/LTO.h @@ -192,8 +192,8 @@ public: /// the fly. /// /// Stream callbacks must be thread safe. -typedef std::function(unsigned Task)> - AddStreamFn; +using AddStreamFn = + std::function(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 @@ -207,17 +207,16 @@ typedef std::function(unsigned Task)> /// /// if (AddStreamFn AddStream = Cache(Task, Key)) /// ProduceContent(AddStream); -typedef std::function - NativeObjectCache; +using NativeObjectCache = + std::function; /// 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( +using ThinBackend = std::function( Config &C, ModuleSummaryIndex &CombinedIndex, StringMap &ModuleToDefinedGVSummaries, - AddStreamFn AddStream, NativeObjectCache Cache)> - ThinBackend; + AddStreamFn AddStream, NativeObjectCache Cache)>; /// This ThinBackend runs the individual backend jobs in-process. ThinBackend createInProcessThinBackend(unsigned ParallelismLevel);