Fix compilation of ldc1

This commit is contained in:
Alexey Prokhin
2011-01-04 20:59:39 +03:00
parent ceeff57700
commit d1ff4e9fd3
4 changed files with 19 additions and 3 deletions

View File

@@ -203,7 +203,7 @@ struct Param
char *hdrdir; // write 'header' file to docdir directory char *hdrdir; // write 'header' file to docdir directory
char *hdrname; // write 'header' file to docname char *hdrname; // write 'header' file to docname
char doXGeneration; // write JSON file bool doXGeneration; // write JSON file
char *xfilename; // write JSON file to xfilename char *xfilename; // write JSON file to xfilename
unsigned debuglevel; // debug level unsigned debuglevel; // debug level

View File

@@ -45,6 +45,9 @@
#endif #endif
#if IN_LLVM #if IN_LLVM
#include "llvm/Type.h"
#include "llvm/LLVMContext.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include <map> #include <map>
@@ -146,10 +149,14 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
} }
srcfile = new File(srcfilename); srcfile = new File(srcfilename);
#if IN_LLVM
// LDC // LDC
llvmForceLogging = false; llvmForceLogging = false;
moduleInfoVar = NULL;
moduleInfoType = new llvm::PATypeHolder(llvm::OpaqueType::get(llvm::getGlobalContext()));
this->doDocComment = doDocComment; this->doDocComment = doDocComment;
this->doHdrGen = doHdrGen; this->doHdrGen = doHdrGen;
#endif
} }
File* Module::buildFilePath(const char* forcename, const char* path, const char* ext) File* Module::buildFilePath(const char* forcename, const char* path, const char* ext)
@@ -282,6 +289,9 @@ void Module::deleteObjFile()
Module::~Module() Module::~Module()
{ {
#if IN_LLVM
delete moduleInfoType;
#endif
} }
const char *Module::kind() const char *Module::kind()

View File

@@ -34,6 +34,8 @@ typedef DValue elem;
namespace llvm { namespace llvm {
class LLVMContext; class LLVMContext;
class Module; class Module;
class GlobalVariable;
class PATypeHolder;
} }
#else #else
@@ -194,8 +196,11 @@ struct Module : Package
void buildTargetFiles(bool singleObj); void buildTargetFiles(bool singleObj);
File* buildFilePath(const char* forcename, const char* path, const char* ext); File* buildFilePath(const char* forcename, const char* path, const char* ext);
Module *isModule() { return this; } Module *isModule() { return this; }
llvm::GlobalVariable* moduleInfoSymbol();
bool llvmForceLogging; bool llvmForceLogging;
llvm::GlobalVariable* moduleInfoVar;
llvm::PATypeHolder* moduleInfoType;
// array ops emitted in this module already // array ops emitted in this module already
StringTable arrayfuncs; StringTable arrayfuncs;

View File

@@ -541,9 +541,10 @@ struct CaseStatement : Statement
CaseStatement* isCaseStatement() { return this; } CaseStatement* isCaseStatement() { return this; }
// LDC #if IN_LLVM
llvm::BasicBlock* bodyBB; llvm::BasicBlock* bodyBB;
llvm::ConstantInt* llvmIdx; llvm::Value* llvmIdx;
#endif
}; };
#if DMDV2 #if DMDV2