mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-01 18:13:18 +01:00
Initial, incomplete ClassReferenceExp::toConstElem implementation.
Allows us to get through a Phobos build without errors.
This commit is contained in:
@@ -55,6 +55,7 @@ struct ClassReferenceExp : Expression
|
||||
/// Same as getFieldIndex, but checks for a direct match with the VarDeclaration
|
||||
int findFieldIndexByName(VarDeclaration *v);
|
||||
#if IN_LLVM
|
||||
llvm::Constant* toConstElem(IRState *irs);
|
||||
#else
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
dt_t **toDtI(dt_t **pdt, int offset);
|
||||
|
||||
19
gen/toir.cpp
19
gen/toir.cpp
@@ -43,6 +43,9 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Needs other includes.
|
||||
#include "ctfe.h"
|
||||
|
||||
llvm::cl::opt<bool> checkPrintf("check-printf-calls",
|
||||
llvm::cl::desc("Validate printf call format strings against arguments"),
|
||||
llvm::cl::ZeroOrMore);
|
||||
@@ -2824,7 +2827,7 @@ static LLValue* write_zeroes(LLValue* mem, unsigned start, unsigned end) {
|
||||
|
||||
DValue* StructLiteralExp::toElem(IRState* p)
|
||||
{
|
||||
Logger::print("StructLiteralExp::toElem: %s @ %s\n", toChars(), type->toChars());
|
||||
IF_LOG Logger::print("StructLiteralExp::toElem: %s @ %s\n", toChars(), type->toChars());
|
||||
LOG_SCOPE;
|
||||
|
||||
if (sinit)
|
||||
@@ -2933,7 +2936,9 @@ DValue* StructLiteralExp::toElem(IRState* p)
|
||||
|
||||
LLConstant* StructLiteralExp::toConstElem(IRState* p)
|
||||
{
|
||||
Logger::print("StructLiteralExp::toConstElem: %s @ %s\n", toChars(), type->toChars());
|
||||
// type can legitimately be null for ClassReferenceExp::value.
|
||||
IF_LOG Logger::print("StructLiteralExp::toConstElem: %s @ %s\n",
|
||||
toChars(), type ? type->toChars() : "(null)");
|
||||
LOG_SCOPE;
|
||||
|
||||
if (sinit)
|
||||
@@ -2965,6 +2970,16 @@ LLConstant* StructLiteralExp::toConstElem(IRState* p)
|
||||
return sd->ir.irStruct->createInitializerConstant(varInits);
|
||||
}
|
||||
|
||||
llvm::Constant* ClassReferenceExp::toConstElem(IRState *p)
|
||||
{
|
||||
IF_LOG Logger::print("ClassReferenceExp::toConstElem: %s @ %s\n",
|
||||
toChars(), type->toChars());
|
||||
LOG_SCOPE;
|
||||
|
||||
// FIXME: Handle type->sym->isInterfaceDeclaration().
|
||||
return value->toConstElem(p);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DValue* InExp::toElem(IRState* p)
|
||||
|
||||
Reference in New Issue
Block a user