mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-13 22:48:43 +03:00
Remove USE_METADATA.
It has been on by default for quite some time now.
This commit is contained in:
parent
9fbad3c4ba
commit
43e27d0dd1
7 changed files with 1 additions and 27 deletions
|
@ -43,11 +43,7 @@ set(CONF_INST_DIR ${SYSCONF_INSTALL_DIR} CACHE PATH "Directory ldc.conf is insta
|
|||
option(USE_BOEHM_GC "use the Boehm garbage collector internally")
|
||||
option(GENERATE_OFFTI "generate complete ClassInfo.offTi arrays")
|
||||
|
||||
# Enabled by default now, will be removed entirely soon if no problems pop up
|
||||
# with the added functionality.
|
||||
option(USE_METADATA "use metadata and related custom optimization passes" ON)
|
||||
|
||||
mark_as_advanced(USE_BOEHM_GC GENERATE_OFFTI USE_METADATA)
|
||||
mark_as_advanced(USE_BOEHM_GC GENERATE_OFFTI)
|
||||
|
||||
if(D_VERSION EQUAL 1)
|
||||
message(FATAL_ERROR "D version 1 is no longer supported.
|
||||
|
@ -281,10 +277,6 @@ if(GENERATE_OFFTI)
|
|||
add_definitions(-DGENERATE_OFFTI)
|
||||
endif()
|
||||
|
||||
if(USE_METADATA)
|
||||
add_definitions(-DUSE_METADATA)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(EXTRA_CXXFLAGS "/W0 /wd4996 /GF /GR- /RTC1")
|
||||
else()
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if USE_METADATA
|
||||
|
||||
#ifndef LDC_GEN_METADATA_H
|
||||
#define LDC_GEN_METADATA_H
|
||||
|
||||
|
@ -56,5 +54,3 @@ enum ClassDataFields {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // USE_METADATA
|
||||
|
|
|
@ -147,12 +147,10 @@ static void addSimplifyDRuntimeCallsPass(const PassManagerBuilder &builder, Pass
|
|||
addPass(pm, createSimplifyDRuntimeCalls());
|
||||
}
|
||||
|
||||
#if USE_METADATA
|
||||
static void addGarbageCollect2StackPass(const PassManagerBuilder &builder, PassManagerBase &pm) {
|
||||
if (builder.OptLevel >= 2 && builder.SizeLevel == 0)
|
||||
addPass(pm, createGarbageCollect2Stack());
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Adds a set of optimization passes to the given module/function pass
|
||||
|
@ -190,10 +188,8 @@ static void addOptimizationPasses(PassManagerBase &mpm, FunctionPassManager &fpm
|
|||
if (!disableSimplifyDruntimeCalls)
|
||||
builder.addExtension(PassManagerBuilder::EP_LoopOptimizerEnd, addSimplifyDRuntimeCallsPass);
|
||||
|
||||
#if USE_METADATA
|
||||
if (!disableGCToStack)
|
||||
builder.addExtension(PassManagerBuilder::EP_LoopOptimizerEnd, addGarbageCollect2StackPass);
|
||||
#endif // USE_METADATA
|
||||
}
|
||||
|
||||
// EP_OptimizerLast does not exist in LLVM 3.0, add it manually below.
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#if USE_METADATA
|
||||
|
||||
//===-- GarbageCollect2Stack.cpp - Promote or remove GC allocations -------===//
|
||||
//
|
||||
// LDC – the LLVM D compiler
|
||||
|
@ -801,5 +799,3 @@ bool isSafeToStackAllocate(Instruction* Alloc, Value* V, DominatorTree& DT,
|
|||
// All uses examined - not captured or live across original allocation.
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // USE_METADATA
|
||||
|
|
|
@ -23,9 +23,7 @@ namespace llvm {
|
|||
// Performs simplifications on runtime calls.
|
||||
llvm::FunctionPass* createSimplifyDRuntimeCalls();
|
||||
|
||||
#if USE_METADATA
|
||||
llvm::FunctionPass* createGarbageCollect2Stack();
|
||||
#endif // USE_METADATA
|
||||
|
||||
llvm::ModulePass* createStripExternalsPass();
|
||||
|
||||
|
|
|
@ -317,7 +317,6 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
|
|||
|
||||
tid->ir.irGlobal = irg;
|
||||
|
||||
#if USE_METADATA
|
||||
// don't do this for void or llvm will crash
|
||||
if (tid->tinfo->ty != Tvoid) {
|
||||
// Add some metadata for use by optimization passes.
|
||||
|
@ -337,7 +336,6 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
|
|||
llvm::makeArrayRef(mdVals, TD_NumFields)));
|
||||
}
|
||||
}
|
||||
#endif // USE_METADATA
|
||||
|
||||
DtoDeclareTypeInfo(tid);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,6 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol()
|
|||
classInfo = new llvm::GlobalVariable(
|
||||
*gIR->module, tc->getMemoryLLType(), false, _linkage, NULL, initname);
|
||||
|
||||
#if USE_METADATA
|
||||
// Generate some metadata on this ClassInfo if it's for a class.
|
||||
ClassDeclaration* classdecl = aggrdecl->isClassDeclaration();
|
||||
if (classdecl && !aggrdecl->isInterfaceDeclaration()) {
|
||||
|
@ -109,7 +108,6 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol()
|
|||
node->addOperand(llvm::MDNode::get(gIR->context(),
|
||||
llvm::makeArrayRef(mdVals, CD_NumFields)));
|
||||
}
|
||||
#endif // USE_METADATA
|
||||
|
||||
return classInfo;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue