diff gen/main.cpp @ 1644:9176437d98be

Add -linkonce-templates for emitting linkonce_odr syms instead of weak_odr.
author Matti Niemenmaa <matti.niemenmaa+hg@iki.fi>
date Tue, 09 Mar 2010 23:07:08 +0200
parents 601d3eea4a68
children 1d2d1aa16841
line wrap: on
line diff
--- a/gen/main.cpp	Mon Mar 08 23:37:40 2010 -0700
+++ b/gen/main.cpp	Tue Mar 09 23:07:08 2010 +0200
@@ -36,6 +36,7 @@
 #include "cond.h"
 
 #include "gen/logger.h"
+#include "gen/linkage.h"
 #include "gen/linker.h"
 #include "gen/irstate.h"
 #include "gen/optimizer.h"
@@ -259,6 +260,10 @@
     global.params.output_ll = opts::output_ll ? OUTPUTFLAGset : OUTPUTFLAGno;
     global.params.output_s  = opts::output_s  ? OUTPUTFLAGset : OUTPUTFLAGno;
 
+    templateLinkage =
+        opts::linkonceTemplates ? LLGlobalValue::LinkOnceODRLinkage
+                                : LLGlobalValue::WeakODRLinkage;
+
     if (global.params.run || !runargs.empty()) {
         // FIXME: how to properly detect the presence of a PositionalEatsArgs
         // option without parameters? We want to emit an error in that case...