mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00
Don't try to strip metadata if we don't generate any
This commit is contained in:
parent
0b8413b4bc
commit
827880e467
1 changed files with 4 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
||||||
#include "gen/linker.h"
|
#include "gen/linker.h"
|
||||||
#include "gen/irstate.h"
|
#include "gen/irstate.h"
|
||||||
#include "gen/toobj.h"
|
#include "gen/toobj.h"
|
||||||
|
#include "gen/metadata.h"
|
||||||
#include "gen/passes/Passes.h"
|
#include "gen/passes/Passes.h"
|
||||||
|
|
||||||
#include "gen/cl_options.h"
|
#include "gen/cl_options.h"
|
||||||
|
@ -871,11 +872,13 @@ int main(int argc, char** argv)
|
||||||
std::string errormsg;
|
std::string errormsg;
|
||||||
for (int i = 0; i < llvmModules.size(); i++)
|
for (int i = 0; i < llvmModules.size(); i++)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_METADATA
|
||||||
//FIXME: workaround for llvm metadata bug:
|
//FIXME: workaround for llvm metadata bug:
|
||||||
// the LinkInModule call asserts with metadata unstripped
|
// the LinkInModule call asserts with metadata unstripped
|
||||||
llvm::ModulePass* stripMD = createStripMetaData();
|
llvm::ModulePass* stripMD = createStripMetaData();
|
||||||
stripMD->runOnModule(*llvmModules[i]);
|
stripMD->runOnModule(*llvmModules[i]);
|
||||||
delete stripMD;
|
delete stripMD;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(linker.LinkInModule(llvmModules[i], &errormsg))
|
if(linker.LinkInModule(llvmModules[i], &errormsg))
|
||||||
error("%s", errormsg.c_str());
|
error("%s", errormsg.c_str());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue