[llvm-commits] [llvm-gcc-4.2] r54959 - /llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp
Bill Wendling
isanbard at gmail.com
Mon Aug 18 17:30:09 PDT 2008
Author: void
Date: Mon Aug 18 19:30:09 2008
New Revision: 54959
URL: http://llvm.org/viewvc/llvm-project?rev=54959&view=rev
Log:
Add this symbol to the linker hack. This way it won't be dropped on the floor.
llvm::TargetMachineRegistry::getClosestStaticTargetForModule
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp?rev=54959&r1=54958&r2=54959&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Mon Aug 18 19:30:09 2008
@@ -20,8 +20,10 @@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Bitcode/ReaderWriter.h"
@@ -38,7 +40,7 @@
/// This function is never dynamically called.
///
void dummy_function() {
- new llvm::ExistingModuleProvider(0);
+ llvm::ModuleProvider *MP = new llvm::ExistingModuleProvider(0);
llvm::createVerifierPass();
llvm::CreateBitcodeWriterPass(*llvm::cout);
llvm::WriteBitcodeToFile(0, *llvm::cout);
@@ -82,8 +84,10 @@
llvm::createMemCpyOptPass();
llvm::createDeadTypeEliminationPass();
llvm::createLoopDeletionPass();
- llvm::createDeadCodeEliminationPass();
-
+
+ std::string Err;
+ llvm::TargetMachineRegistry::getClosestStaticTargetForModule(*MP->getModule(),
+ Err);
}
/* LLVM LOCAL end (ENTIRE FILE!) */
More information about the llvm-commits
mailing list