[PATCH] gold plugin: move target initialization to the top of the onload function.

Peter Collingbourne peter at pcc.me.uk
Thu Jul 3 16:36:34 PDT 2014


Closed by commit rL212303 (authored by @pcc).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D4372

Files:
  llvm/trunk/tools/gold/gold-plugin.cpp

Index: llvm/trunk/tools/gold/gold-plugin.cpp
===================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp
+++ llvm/trunk/tools/gold/gold-plugin.cpp
@@ -135,6 +135,12 @@
 
 extern "C" ld_plugin_status onload(ld_plugin_tv *tv);
 ld_plugin_status onload(ld_plugin_tv *tv) {
+  InitializeAllTargetInfos();
+  InitializeAllTargets();
+  InitializeAllTargetMCs();
+  InitializeAllAsmParsers();
+  InitializeAllAsmPrinters();
+
   // We're given a pointer to the first transfer vector. We read through them
   // until we find one where tv_tag == LDPT_NULL. The REGISTER_* tagged values
   // contain pointers to functions that we need to call to register our own
@@ -228,11 +234,6 @@
   if (!RegisteredAllSymbolsRead)
     return LDPS_OK;
 
-  InitializeAllTargetInfos();
-  InitializeAllTargets();
-  InitializeAllTargetMCs();
-  InitializeAllAsmParsers();
-  InitializeAllAsmPrinters();
   CodeGen = new LTOCodeGenerator();
 
   // Pass through extra options to the code generator.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4372.11070.patch
Type: text/x-patch
Size: 1027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140703/29b7d68d/attachment.bin>


More information about the llvm-commits mailing list