mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-15 04:13:14 +01:00
[svn r344] Fixed some very minor issues with the usage listing when calling llvmdc with no arguments.
Changed the way moduleinfo is registered to use the same approach as DMD, this eliminates the need for correct linking order and should make the way for using a natively compiled runtime library. This should speed up linking tremendously and should now be possible. Fixed the llvm.used array to only be emitted if really necessary.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "aggregate.h"
|
||||
#include "declaration.h"
|
||||
#include "init.h"
|
||||
#include "module.h"
|
||||
|
||||
#include "gen/tollvm.h"
|
||||
#include "gen/irstate.h"
|
||||
@@ -724,3 +725,30 @@ const LLStructType* DtoMutexType()
|
||||
gIR->module->addTypeName("D_CRITICAL_SECTION", pmutex);
|
||||
return pmutex;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const LLStructType* DtoModuleReferenceType()
|
||||
{
|
||||
if (gIR->moduleRefType)
|
||||
return gIR->moduleRefType;
|
||||
|
||||
// this is a recursive type so start out with the opaque
|
||||
LLOpaqueType* opaque = LLOpaqueType::get();
|
||||
|
||||
// add members
|
||||
std::vector<const LLType*> types;
|
||||
types.push_back(getPtrToType(opaque));
|
||||
types.push_back(DtoType(Module::moduleinfo->type));
|
||||
|
||||
// resolve type
|
||||
const LLStructType* st = LLStructType::get(types);
|
||||
LLPATypeHolder pa(st);
|
||||
opaque->refineAbstractTypeTo(pa.get());
|
||||
st = isaStruct(pa.get());
|
||||
|
||||
// done
|
||||
gIR->moduleRefType = st;
|
||||
gIR->module->addTypeName("ModuleReference", st);
|
||||
return st;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user