mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Renamed IrType::get/IrType::getD, treat classes as the special case they are.
This commit is contained in:
@@ -78,9 +78,9 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol()
|
||||
IrTypeClass* tc = stripModifiers(cinfo->type)->irtype->isClass();
|
||||
assert(tc && "invalid ClassInfo type");
|
||||
|
||||
// classinfos cannot be constants since they're used a locks for synchronized
|
||||
// classinfos cannot be constants since they're used as locks for synchronized
|
||||
classInfo = new llvm::GlobalVariable(
|
||||
*gIR->module, tc->getType(), false, _linkage, NULL, initname);
|
||||
*gIR->module, tc->getMemoryLLType(), false, _linkage, NULL, initname);
|
||||
|
||||
#if USE_METADATA
|
||||
// Generate some metadata on this ClassInfo if it's for a class.
|
||||
|
||||
@@ -71,11 +71,9 @@ public:
|
||||
#endif
|
||||
|
||||
///
|
||||
Type* getD() { return dtype; }
|
||||
Type* getDType() { return dtype; }
|
||||
///
|
||||
virtual llvm::Type* get() { return type; }
|
||||
///
|
||||
llvm::Type* getType() { return type; }
|
||||
virtual llvm::Type* getLLType() { return type; }
|
||||
|
||||
///
|
||||
virtual llvm::Type* buildType() = 0;
|
||||
|
||||
@@ -279,7 +279,7 @@ llvm::Type* IrTypeClass::buildType()
|
||||
|
||||
IF_LOG Logger::cout() << "class type: " << *type << std::endl;
|
||||
|
||||
return get();
|
||||
return getLLType();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -349,13 +349,20 @@ std::vector<llvm::Type*> IrTypeClass::buildVtblType(Type* first, Array* vtbl_arr
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
llvm::Type * IrTypeClass::get()
|
||||
llvm::Type * IrTypeClass::getLLType()
|
||||
{
|
||||
return llvm::PointerType::get(type, 0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
llvm::Type * IrTypeClass::getMemoryLLType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
size_t IrTypeClass::getInterfaceIndex(ClassDeclaration * inter)
|
||||
{
|
||||
ClassIndexMap::iterator it = interfaceMap.find(inter);
|
||||
|
||||
@@ -31,7 +31,11 @@ public:
|
||||
llvm::Type* buildType();
|
||||
|
||||
///
|
||||
llvm::Type* get();
|
||||
llvm::Type* getLLType();
|
||||
|
||||
/// Returns the actual storage type, i.e. without the indirection
|
||||
/// for the class reference.
|
||||
llvm::Type* getMemoryLLType();
|
||||
|
||||
/// Returns the vtable type for this class.
|
||||
llvm::Type* getVtbl() { return vtbl_type; }
|
||||
|
||||
Reference in New Issue
Block a user