]> granicus.if.org Git - llvm/commitdiff
[LTO] Migrate typedef to using
authorFangrui Song <maskray@google.com>
Thu, 2 May 2019 10:52:34 +0000 (10:52 +0000)
committerFangrui Song <maskray@google.com>
Thu, 2 May 2019 10:52:34 +0000 (10:52 +0000)
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

include/llvm/LTO/Caching.h
include/llvm/LTO/Config.h
include/llvm/LTO/LTO.h

index c20d819208336ea7006ea2daeee5e3bceea5a14b..4c4a708d24e9d7989c6da6b99976ee049c5e66f6 100644 (file)
@@ -24,8 +24,8 @@ namespace lto {
 /// (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
index 1e2eeab11c0a29ce38c29b13e73d5187fd265063..6db722d21337f9a8ec0bfaff72a25011be662cd5 100644 (file)
@@ -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<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.
@@ -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<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
index 8fcf1075721c47ba79155ab26ee5bb2413abc140..489561e8c82b4cb70e265aaeefa01518ade5cf0e 100644 (file)
@@ -192,8 +192,8 @@ public:
 /// 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
@@ -207,17 +207,16 @@ typedef std::function<std::unique_ptr<NativeObjectStream>(unsigned Task)>
 ///
 /// 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);