From 827880e4672bf81c0b3a9661fb9f92c38857c24c Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Sun, 17 May 2009 22:40:02 +0200 Subject: [PATCH] Don't try to strip metadata if we don't generate any --- gen/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gen/main.cpp b/gen/main.cpp index ab67b8a4..da7f5aa6 100644 --- a/gen/main.cpp +++ b/gen/main.cpp @@ -36,6 +36,7 @@ #include "gen/linker.h" #include "gen/irstate.h" #include "gen/toobj.h" +#include "gen/metadata.h" #include "gen/passes/Passes.h" #include "gen/cl_options.h" @@ -871,12 +872,14 @@ int main(int argc, char** argv) std::string errormsg; for (int i = 0; i < llvmModules.size(); i++) { +#ifdef USE_METADATA //FIXME: workaround for llvm metadata bug: // the LinkInModule call asserts with metadata unstripped llvm::ModulePass* stripMD = createStripMetaData(); stripMD->runOnModule(*llvmModules[i]); delete stripMD; - +#endif + if(linker.LinkInModule(llvmModules[i], &errormsg)) error("%s", errormsg.c_str()); delete llvmModules[i];