Skip to content

Commit

Permalink
opt: Initialize asm printers
Browse files Browse the repository at this point in the history
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'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210914 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tobiasgrosser committed Jun 13, 2014
1 parent cc0d35a commit df46288
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/opt/opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ int main(int argc, char **argv) {

InitializeAllTargets();
InitializeAllTargetMCs();
InitializeAllAsmPrinters();

// Initialize passes
PassRegistry &Registry = *PassRegistry::getPassRegistry();
Expand Down

0 comments on commit df46288

Please sign in to comment.