[lld] 7ea662e - [ELF] Replace one make_unique from r316378 with a stack object. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 28 15:32:34 PST 2021


Author: Fangrui Song
Date: 2021-11-28T15:32:29-08:00
New Revision: 7ea662e2dda021bfc4c68354a5fe359748dd4ce4

URL: https://github.com/llvm/llvm-project/commit/7ea662e2dda021bfc4c68354a5fe359748dd4ce4
DIFF: https://github.com/llvm/llvm-project/commit/7ea662e2dda021bfc4c68354a5fe359748dd4ce4.diff

LOG: [ELF] Replace one make_unique from r316378 with a stack object. NFC

Added: 
    

Modified: 
    lld/ELF/LinkerScript.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 40befb61ab09..9de5125ff869 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -1327,8 +1327,8 @@ const Defined *LinkerScript::assignAddresses() {
     dot += getHeaderSize();
   }
 
-  auto deleter = std::make_unique<AddressState>();
-  ctx = deleter.get();
+  AddressState state;
+  ctx = &state;
   errorOnMissingSection = true;
   switchTo(aether);
 


        


More information about the llvm-commits mailing list