From 7f017608a8f4bc595f49db1afa7554c73e71e286 Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Tue, 26 Nov 2013 07:56:50 +0100 Subject: [PATCH] Use enum literal instead of constant --- gen/dibuilder.cpp | 2 +- gen/module.cpp | 2 +- gen/structs.cpp | 2 +- gen/typinf.cpp | 2 +- ir/irtypestruct.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gen/dibuilder.cpp b/gen/dibuilder.cpp index 209a3254..e2799389 100644 --- a/gen/dibuilder.cpp +++ b/gen/dibuilder.cpp @@ -290,7 +290,7 @@ llvm::DIType ldc::DIBuilder::CreateCompositeType(Type *type) // if we don't know the aggregate's size, we don't know enough about it // to provide debug info. probably a forward-declared struct? - if (sd->sizeok == 0) + if (sd->sizeok == SIZEOKnone) #if LDC_LLVM_VER >= 304 return DBuilder.createUnspecifiedType(sd->toChars()); #else diff --git a/gen/module.cpp b/gen/module.cpp index 7685d894..b2739f55 100644 --- a/gen/module.cpp +++ b/gen/module.cpp @@ -536,7 +536,7 @@ void Module::genmoduleinfo() Logger::println("skipping interface '%s' in moduleinfo", cd->toPrettyChars()); continue; } - else if (cd->sizeok != 1) + else if (cd->sizeok != SIZEOKdone) { Logger::println("skipping opaque class declaration '%s' in moduleinfo", cd->toPrettyChars()); continue; diff --git a/gen/structs.cpp b/gen/structs.cpp index ed2171c9..690d93d7 100644 --- a/gen/structs.cpp +++ b/gen/structs.cpp @@ -41,7 +41,7 @@ void DtoResolveStruct(StructDeclaration* sd) DtoType(sd->type); // if it's a forward declaration, all bets are off. The type should be enough - if (sd->sizeok != 1) + if (sd->sizeok != SIZEOKdone) return; // create the IrAggr diff --git a/gen/typinf.cpp b/gen/typinf.cpp index d1394a05..3e1d9502 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -596,7 +596,7 @@ void TypeInfoStructDeclaration::llvmDefine() StructDeclaration *sd = tc->sym; // can't emit typeinfo for forward declarations - if (sd->sizeok != 1) + if (sd->sizeok != SIZEOKdone) { sd->error("cannot emit TypeInfo for forward declaration"); fatal(); diff --git a/ir/irtypestruct.cpp b/ir/irtypestruct.cpp index d9fa3937..44b805fa 100644 --- a/ir/irtypestruct.cpp +++ b/ir/irtypestruct.cpp @@ -88,7 +88,7 @@ IrTypeStruct* IrTypeStruct::get(StructDeclaration* sd) LOG_SCOPE; // if it's a forward declaration, all bets are off, stick with the opaque - if (sd->sizeok != 1) + if (sd->sizeok != SIZEOKdone) return t; // TODO:: Somehow merge this with IrAggr::createInitializerConstant, or