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:
kai
2012-09-16 19:50:21 +02:00
parent 98f9742db5
commit 940d6e907f
7 changed files with 84 additions and 94 deletions

View File

@@ -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();