Mercurial > projects > ldc
changeset 1533:d1652c8fb4f6
Get rid of USE_METADATA
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Sat, 11 Jul 2009 14:19:21 +0200 |
parents | c88b16d4a13c |
children | 8ca25bd765a3 |
files | gen/main.cpp gen/metadata.h gen/optimizer.cpp gen/passes/GarbageCollect2Stack.cpp gen/passes/Passes.h gen/passes/StripMetaData.cpp gen/typinf.cpp ir/irclass.cpp |
diffstat | 8 files changed, 0 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/main.cpp Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/main.cpp Sat Jul 11 14:19:21 2009 +0200 @@ -921,13 +921,11 @@ 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());
--- a/gen/metadata.h Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/metadata.h Sat Jul 11 14:19:21 2009 +0200 @@ -15,7 +15,6 @@ return N->getElement(i); } -#define USE_METADATA #define METADATA_LINKAGE_TYPE llvm::GlobalValue::WeakODRLinkage // *** Metadata for TypeInfo instances ***
--- a/gen/optimizer.cpp Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/optimizer.cpp Sat Jul 11 14:19:21 2009 +0200 @@ -53,7 +53,6 @@ cl::desc("Disable simplification of runtime calls in -O<N>"), cl::ZeroOrMore); -#ifdef USE_METADATA static cl::opt<bool> disableGCToStack("disable-gc2stack", cl::desc("Disable promotion of GC allocations to stack memory in -O<N>"), @@ -64,7 +63,6 @@ disableStripMetaData("disable-strip-metadata", cl::desc("Disable default metadata stripping (not recommended)"), cl::ZeroOrMore); -#endif static cl::opt<opts::BoolOrDefaultAdapter, false, opts::FlagParser> enableInlining("inlining", @@ -225,7 +223,6 @@ bool ldc_optimize_module(llvm::Module* m) { if (!optimize()) { -#ifdef USE_METADATA if (!disableStripMetaData) { // This one always needs to run if metadata is generated, because // the code generator will assert if it's not used. @@ -233,7 +230,6 @@ stripMD->runOnModule(*m); delete stripMD; } -#endif return false; } @@ -272,13 +268,11 @@ if (optimize) addPassesForOptLevel(pm); -#ifdef USE_METADATA if (!disableStripMetaData) { // This one is purposely not disabled by disableLangSpecificPasses // because the code generator will assert if it's not used. addPass(pm, createStripMetaData()); } -#endif pm.run(*m); return true;
--- a/gen/passes/GarbageCollect2Stack.cpp Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/passes/GarbageCollect2Stack.cpp Sat Jul 11 14:19:21 2009 +0200 @@ -14,11 +14,6 @@ #include "gen/metadata.h" -// This pass doesn't work without metadata, so #ifdef it out entirely if the -// LLVM version in use doesn't support it. -#ifdef USE_METADATA - - #define DEBUG_TYPE "dgc2stack" #include "Passes.h" @@ -647,6 +642,3 @@ // All uses examined - not captured or live across original allocation. return true; } - - -#endif //USE_METADATA
--- a/gen/passes/Passes.h Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/passes/Passes.h Sat Jul 11 14:19:21 2009 +0200 @@ -10,10 +10,8 @@ // Performs simplifications on runtime calls. llvm::FunctionPass* createSimplifyDRuntimeCalls(); -#ifdef USE_METADATA llvm::FunctionPass* createGarbageCollect2Stack(); llvm::ModulePass* createStripMetaData(); -#endif llvm::ModulePass* createStripExternalsPass();
--- a/gen/passes/StripMetaData.cpp Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/passes/StripMetaData.cpp Sat Jul 11 14:19:21 2009 +0200 @@ -19,11 +19,6 @@ #include "gen/metadata.h" -// This pass isn't needed without metadata, so #ifdef it out entirely if the -// LLVM version in use doesn't support it. -#ifdef USE_METADATA - - #define DEBUG_TYPE "strip-metadata" #include "Passes.h" @@ -79,6 +74,3 @@ } return Changed; } - - -#endif //USE_METADATA
--- a/gen/typinf.cpp Sat Jul 11 14:09:33 2009 +0200 +++ b/gen/typinf.cpp Sat Jul 11 14:19:21 2009 +0200 @@ -303,7 +303,6 @@ tid->ir.irGlobal = irg; -#ifdef USE_METADATA // Add some metadata for use by optimization passes. std::string metaname = std::string(TD_PREFIX) + mangle; LLGlobalVariable* meta = gIR->module->getGlobalVariable(metaname); @@ -321,7 +320,6 @@ new llvm::GlobalVariable(*gIR->module, metadata->getType(), true, METADATA_LINKAGE_TYPE, metadata, metaname); } -#endif DtoDeclareTypeInfo(tid); }
--- a/ir/irclass.cpp Sat Jul 11 14:09:33 2009 +0200 +++ b/ir/irclass.cpp Sat Jul 11 14:19:21 2009 +0200 @@ -71,9 +71,7 @@ classInfo = new llvm::GlobalVariable( *gIR->module, tc->getPA().get(), false, _linkage, NULL, initname); -#ifdef USE_METADATA // Generate some metadata on this ClassInfo if it's for a class. - ClassDeclaration* classdecl = aggrdecl->isClassDeclaration(); if (classdecl && !aggrdecl->isInterfaceDeclaration()) { // Gather information @@ -92,7 +90,6 @@ new llvm::GlobalVariable(*gIR->module, metadata->getType(), true, METADATA_LINKAGE_TYPE, metadata, CD_PREFIX + initname); } -#endif return classInfo; }