[PATCH] D22396: ELF: Remove member variables that are used only in one function.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 20:14:14 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275526: ELF: Remove member variables that are used only in one function. (authored by ruiu).

Changed prior to commit:
  https://reviews.llvm.org/D22396?vs=64082&id=64083#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22396

Files:
  lld/trunk/ELF/LTO.cpp
  lld/trunk/ELF/LTO.h

Index: lld/trunk/ELF/LTO.h
===================================================================
--- lld/trunk/ELF/LTO.h
+++ lld/trunk/ELF/LTO.h
@@ -44,11 +44,9 @@
       const std::function<std::unique_ptr<llvm::TargetMachine>()> &TMFactory);
 
   std::unique_ptr<llvm::Module> Combined;
-  llvm::IRMover Mover;
   std::vector<SmallString<0>> OwningData;
   llvm::StringSet<> InternalizedSyms;
   llvm::StringSet<> AsmUndefinedRefs;
-  std::string TheTriple;
 };
 }
 }
Index: lld/trunk/ELF/LTO.cpp
===================================================================
--- lld/trunk/ELF/LTO.cpp
+++ lld/trunk/ELF/LTO.cpp
@@ -144,8 +144,7 @@
 }
 
 BitcodeCompiler::BitcodeCompiler()
-    : Combined(new llvm::Module("ld-temp.o", Driver->Context)),
-      Mover(*Combined) {}
+    : Combined(new llvm::Module("ld-temp.o", Driver->Context)) {}
 
 static void undefine(Symbol *S) {
   replaceBody<Undefined>(S, S->body()->getName(), STV_DEFAULT, S->body()->Type);
@@ -236,6 +235,7 @@
     Keep.push_back(GV);
   }
 
+  IRMover Mover(*Combined);
   if (Error E = Mover.move(Obj->takeModule(), Keep,
                            [](GlobalValue &, IRMover::ValueAdder) {})) {
     handleAllErrors(std::move(E), [&](const llvm::ErrorInfoBase &EIB) {
@@ -286,13 +286,13 @@
 // Merge all the bitcode files we have seen, codegen the result
 // and return the resulting ObjectFile.
 std::vector<std::unique_ptr<InputFile>> BitcodeCompiler::compile() {
-  TheTriple = Combined->getTargetTriple();
   for (const auto &Name : InternalizedSyms) {
     GlobalValue *GV = Combined->getNamedValue(Name.first());
     assert(GV);
     internalize(*GV);
   }
 
+  std::string TheTriple = Combined->getTargetTriple();
   std::string Msg;
   const Target *T = TargetRegistry::lookupTarget(TheTriple, Msg);
   if (!T)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22396.64083.patch
Type: text/x-patch
Size: 1789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160715/596a3264/attachment.bin>


More information about the llvm-commits mailing list