Removed redundant global.params.os field.

I hope I have untangled the checks for "native" Windows (Triple::Win32)
vs. Windows/MinGW/Cygwin (Triple::isOSWindows) correctly.

MinGW needs some default libraries as well, has to be fixed later.
This commit is contained in:
David Nadlinger
2013-02-07 21:20:54 +01:00
parent 4e02f41f31
commit d4b391249d
15 changed files with 71 additions and 59 deletions
-1
View File
@@ -181,7 +181,6 @@ struct Param
#endif
char vtls; // identify thread local variables
// KN Start merge conflict
OS os; // target OS
bool is64bit; // generate 64 bit code
bool useDeprecated; // allow use of deprecated features
bool useAssert; // generate runtime code for assert()'s
+4 -2
View File
@@ -168,6 +168,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
#endif
}
#if IN_LLVM
File* Module::buildFilePath(const char* forcename, const char* path, const char* ext)
{
const char *argobj;
@@ -219,7 +220,6 @@ File* Module::buildFilePath(const char* forcename, const char* path, const char*
return new File(FileName::forceExt(argobj, ext));
}
// LDC
static void check_and_add_output_file(Module* NewMod, const std::string& str)
{
typedef std::map<std::string, Module*> map_t;
@@ -252,7 +252,8 @@ void Module::buildTargetFiles(bool singleObj)
else if (global.params.output_s)
objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.s_ext);
else
objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.params.os == OSWindows ? global.obj_ext_alt : global.obj_ext);
objfile = Module::buildFilePath(global.params.objname, global.params.objdir,
global.params.targetTriple.isOSWindows() ? global.obj_ext_alt : global.obj_ext);
}
if(doDocComment && !docfile)
docfile = Module::buildFilePath(global.params.docname, global.params.docdir, global.doc_ext);
@@ -285,6 +286,7 @@ void Module::buildTargetFiles(bool singleObj)
if (hdrfile)
check_and_add_output_file(this, hdrfile->name->str);
}
#endif
void Module::deleteObjFile()
{
+9 -2
View File
@@ -671,11 +671,18 @@ enum LINK Parser::parseLinkage()
}
else if (id == Id::System)
{
// LDC we configure target at runtime
if (global.params.os == OSWindows)
#if IN_LLVM
if (global.params.targetTriple.isOSWindows())
link = LINKwindows;
else
link = LINKc;
#else
#if _WIN32
link = LINKwindows;
#else
link = LINKc;
#endif
#endif
}
else
{
+2 -2
View File
@@ -47,9 +47,9 @@ int os_critsecsize()
// Return sizeof(RTL_CRITICAL_SECTION)
return global.params.is64bit ? 40 : 24;
#else
if (global.params.os == OSWindows)
if (global.params.targetTriple.isOSWindows())
return global.params.is64bit ? 40 : 24;
else if (global.params.os == OSFreeBSD)
else if (global.params.targetTriple.getOS() == llvm::Triple::FreeBSD)
return sizeof(size_t);
else
return sizeof(pthread_mutex_t);