Skip to content

Commit 90e1558

Browse files
committed
Use make_unique
1 parent ace080c commit 90e1558

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/AST/PluginRegistry.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ PluginRegistry::loadLibraryPlugin(StringRef path) {
6767
}
6868
#endif
6969

70-
storage = std::unique_ptr<LoadedLibraryPlugin>(new LoadedLibraryPlugin(lib));
70+
storage = std::make_unique<LoadedLibraryPlugin>(lib);
7171
return storage.get();
7272
}
7373

@@ -111,8 +111,8 @@ PluginRegistry::loadExecutablePlugin(StringRef path) {
111111
"not executable");
112112
}
113113

114-
auto plugin = std::unique_ptr<LoadedExecutablePlugin>(
115-
new LoadedExecutablePlugin(path, stat.getLastModificationTime()));
114+
auto plugin = std::make_unique<LoadedExecutablePlugin>(
115+
path, stat.getLastModificationTime());
116116

117117
plugin->setDumpMessaging(dumpMessaging);
118118

@@ -153,9 +153,9 @@ llvm::Error LoadedExecutablePlugin::spawnIfNeeded() {
153153
return llvm::errorCodeToError(childInfo.getError());
154154
}
155155

156-
Process = std::unique_ptr<PluginProcess>(
157-
new PluginProcess(childInfo->Pid, childInfo->ReadFileDescriptor,
158-
childInfo->WriteFileDescriptor));
156+
Process = std::make_unique<PluginProcess>(childInfo->Pid,
157+
childInfo->ReadFileDescriptor,
158+
childInfo->WriteFileDescriptor);
159159

160160
// Call "on reconnect" callbacks.
161161
for (auto *callback : onReconnect) {

0 commit comments

Comments
 (0)