mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Take advantage of Triple and TargetData.
A lot of system specific knowledge is already present in LLVM. This is used to populate several fields in global.params instead of hard coded values in main(). Ensures that the frontend and LLVM have always the same values.
This commit is contained in:
@@ -382,7 +382,7 @@ int linkObjToBinaryWin(bool sharedLib)
|
||||
int linkObjToBinary(bool sharedLib)
|
||||
{
|
||||
int status;
|
||||
if (llvm::Triple(global.params.targetTriple).isOSWindows())
|
||||
if (global.params.targetTriple.getOS() == llvm::Triple::Win32)
|
||||
status = linkObjToBinaryWin(sharedLib);
|
||||
else
|
||||
status = linkObjToBinaryGcc(sharedLib);
|
||||
@@ -395,7 +395,7 @@ void createStaticLibrary()
|
||||
{
|
||||
Logger::println("*** Creating static library ***");
|
||||
|
||||
const bool isTargetWindows = llvm::Triple(global.params.targetTriple).isOSWindows();
|
||||
const bool isTargetWindows = global.params.targetTriple.getOS() == llvm::Triple::Win32;
|
||||
|
||||
// find archiver
|
||||
llvm::sys::Path tool = isTargetWindows ? getLib() : getArchiver();
|
||||
|
||||
Reference in New Issue
Block a user