summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-06-23 20:46:48 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-06-23 20:46:48 +0000
commitd80d8690af2ce54f7f624889b5628fa3dc61cc27 (patch)
treee136bb9eca617d20f273f938a30e9138976cfea6 /utils
parent06509db63088f7e4aed4e47fc9c73317eff461ec (diff)
downloadllvm-d80d8690af2ce54f7f624889b5628fa3dc61cc27.tar.gz
llvm-d80d8690af2ce54f7f624889b5628fa3dc61cc27.tar.bz2
llvm-d80d8690af2ce54f7f624889b5628fa3dc61cc27.tar.xz
Make llvmc work again.
Chris recently broke llvmc with his Makefile changes (r75379). That patch made the global change .o -> .a, which caused built-in llvmc plugins to stop working since plugin initialization in llvmc is based on static variables not referenced from the main executable. This patch implements auto-generated forced references to the plugin libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 36f094d326..e9acd9668c 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -1984,6 +1984,7 @@ void EmitRegisterPlugin(int Priority, std::ostream& O) {
/// additional declarations.
void EmitIncludes(std::ostream& O) {
O << "#include \"llvm/CompilerDriver/CompilationGraph.h\"\n"
+ << "#include \"llvm/CompilerDriver/ForceLinkageMacros.h\"\n"
<< "#include \"llvm/CompilerDriver/Plugin.h\"\n"
<< "#include \"llvm/CompilerDriver/Tool.h\"\n\n"
@@ -2106,7 +2107,13 @@ void EmitPluginCode(const PluginData& Data, std::ostream& O) {
// Emit code for plugin registration.
EmitRegisterPlugin(Data.Priority, O);
- O << "} // End anonymous namespace.\n";
+ O << "} // End anonymous namespace.\n\n";
+
+ // Force linkage magic.
+ O << "namespace llvmc {\n";
+ O << "LLVMC_FORCE_LINKAGE_DECL(LLVMC_PLUGIN_NAME) {}\n";
+ O << "}\n";
+
// EOF
}