[llvm] r210914 - opt: Initialize asm printers

Tobias Grosser tobias at grosser.es
Fri Jun 13 09:12:09 PDT 2014


Author: grosser
Date: Fri Jun 13 11:12:08 2014
New Revision: 210914

URL: http://llvm.org/viewvc/llvm-project?rev=210914&view=rev
Log:
opt: Initialize asm printers

Without initializing the assembly printers a shared library build of opt is
linked with these libraries whereas for a static build these libraries are dead
code eliminated. This is unfortunate for plugins in case they want to use them,
as they neither can rely on opt to provide this functionality nor can they link
the printers in themselves as this breaks with a shared object build of opt.

This patch calls InitializeAllAsmPrinters() from opt, which increases the static
binary size from 50MB -> 52MB on my system (all backends compiled) and causes no
measurable increase in the time needed to run 'make check'.

Modified:
    llvm/trunk/tools/opt/opt.cpp

Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=210914&r1=210913&r2=210914&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Fri Jun 13 11:12:08 2014
@@ -336,6 +336,7 @@ int main(int argc, char **argv) {
 
   InitializeAllTargets();
   InitializeAllTargetMCs();
+  InitializeAllAsmPrinters();
 
   // Initialize passes
   PassRegistry &Registry = *PassRegistry::getPassRegistry();





More information about the llvm-commits mailing list