Fixed compilation of ldc1

This commit is contained in:
Alexey Prokhin 2012-04-22 12:26:25 +04:00
parent f4d8021e5a
commit 8c5cf40bb5
2 changed files with 4 additions and 1 deletions

View file

@ -13,6 +13,7 @@
#include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO.h"
#include "mars.h" // error() #include "mars.h" // error()
#include "root.h"
#include <cstring> // strcmp(); #include <cstring> // strcmp();
using namespace llvm; using namespace llvm;

View file

@ -239,7 +239,9 @@ DValue* VarExp::toElem(IRState* p)
{ {
Logger::println("FuncDeclaration"); Logger::println("FuncDeclaration");
LLValue* func = 0; LLValue* func = 0;
#if DMDV2
fdecl = fdecl->toAliasFunc(); fdecl = fdecl->toAliasFunc();
#endif
if (fdecl->llvmInternal == LLVMinline_asm) { if (fdecl->llvmInternal == LLVMinline_asm) {
error("special ldc inline asm is not a normal function"); error("special ldc inline asm is not a normal function");
fatal(); fatal();
@ -3007,6 +3009,7 @@ DValue* AssocArrayLiteralExp::toElem(IRState* p)
Type* aatype = basetype; Type* aatype = basetype;
Type* vtype = aatype->nextOf(); Type* vtype = aatype->nextOf();
#if DMDV2
if (!keys->dim) if (!keys->dim)
goto LruntimeInit; goto LruntimeInit;
@ -3018,7 +3021,6 @@ DValue* AssocArrayLiteralExp::toElem(IRState* p)
aatype = aatype->semantic(loc, NULL); aatype = aatype->semantic(loc, NULL);
} }
#if DMDV2
{ {
std::vector<LLConstant*> keysInits, valuesInits; std::vector<LLConstant*> keysInits, valuesInits;
for (size_t i = 0, n = keys->dim; i < n; ++i) for (size_t i = 0, n = keys->dim; i < n; ++i)