Simplify. NFC.
authorRui Ueyama <ruiu@google.com>
Sat, 16 Jul 2016 04:19:29 +0000 (04:19 +0000)
committerRui Ueyama <ruiu@google.com>
Sat, 16 Jul 2016 04:19:29 +0000 (04:19 +0000)
llvm-svn: 275675

lld/ELF/Writer.cpp

index 322e9d1..ee5ce5b 100644 (file)
@@ -1257,8 +1257,7 @@ template <class ELFT> void Writer<ELFT>::writeSections() {
 }
 
 template <class ELFT> void Writer<ELFT>::writeBuildId() {
-  BuildIdSection<ELFT> *S = Out<ELFT>::BuildId;
-  if (!S)
+  if (!Out<ELFT>::BuildId)
     return;
 
   // Compute a hash of all sections except .debug_* sections.
@@ -1275,7 +1274,7 @@ template <class ELFT> void Writer<ELFT>::writeBuildId() {
     Last = End;
   }
   Regions.push_back({Last, Start + FileSize});
-  S->writeBuildId(Regions);
+  Out<ELFT>::BuildId->writeBuildId(Regions);
 }
 
 template void elf::writeResult<ELF32LE>(SymbolTable<ELF32LE> *Symtab);