[lld] r245281 - Do not use unique pointers. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 02:13:26 PDT 2015


Author: ruiu
Date: Tue Aug 18 04:13:25 2015
New Revision: 245281

URL: http://llvm.org/viewvc/llvm-project?rev=245281&view=rev
Log:
Do not use unique pointers. NFC.

These unique pointers have the exact same lifetime as automatic
variables, so use automatic variables instead.

Modified:
    lld/trunk/COFF/Driver.cpp
    lld/trunk/ELF/Driver.cpp

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=245281&r1=245280&r2=245281&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Tue Aug 18 04:13:25 2015
@@ -44,10 +44,10 @@ Configuration *Config;
 LinkerDriver *Driver;
 
 void link(llvm::ArrayRef<const char *> Args) {
-  auto C = make_unique<Configuration>();
-  Config = C.get();
-  auto D = make_unique<LinkerDriver>();
-  Driver = D.get();
+  Configuration C;
+  LinkerDriver D;
+  Config = &C;
+  Driver = &D;
   return Driver->link(Args);
 }
 

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=245281&r1=245280&r2=245281&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Aug 18 04:13:25 2015
@@ -25,8 +25,8 @@ namespace elf2 {
 Configuration *Config;
 
 void link(ArrayRef<const char *> Args) {
-  auto C = make_unique<Configuration>();
-  Config = C.get();
+  Configuration C;
+  Config = &C;
   LinkerDriver().link(Args.slice(1));
 }
 




More information about the llvm-commits mailing list