From d4a2f5bbfa60651dbb424f5748745d8071d16555 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Fri, 12 Oct 2012 09:55:13 +0000 Subject: [PATCH] Add float-abi and softfloat options to lli Patch by Amara Emerson. llvm-svn: 165791 --- llvm/tools/lli/lli.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 57a31f2..0ee7238 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -171,6 +171,23 @@ namespace { cl::init(false)); cl::opt + GenerateSoftFloatCalls("soft-float", + cl::desc("Generate software floating point library calls"), + cl::init(false)); + + cl::opt + FloatABIForCalls("float-abi", + cl::desc("Choose float ABI type"), + cl::init(FloatABI::Default), + cl::values( + clEnumValN(FloatABI::Default, "default", + "Target default float ABI type"), + clEnumValN(FloatABI::Soft, "soft", + "Soft float ABI (implied by -soft-float)"), + clEnumValN(FloatABI::Hard, "hard", + "Hard float ABI (uses FP registers)"), + clEnumValEnd)); + cl::opt // In debug builds, make this default to true. #ifdef NDEBUG #define EMIT_DEBUG false @@ -555,15 +572,22 @@ int main(int argc, char **argv, char * const *envp) { } builder.setOptLevel(OLvl); + TargetOptions Options; + Options.UseSoftFloat = GenerateSoftFloatCalls; + if (FloatABIForCalls != FloatABI::Default) + Options.FloatABIType = FloatABIForCalls; + if (GenerateSoftFloatCalls) + FloatABIForCalls = FloatABI::Soft; + // Remote target execution doesn't handle EH or debug registration. if (!RemoteMCJIT) { - TargetOptions Options; Options.JITExceptionHandling = EnableJITExceptionHandling; Options.JITEmitDebugInfo = EmitJitDebugInfo; Options.JITEmitDebugInfoToDisk = EmitJitDebugInfoToDisk; - builder.setTargetOptions(Options); } + builder.setTargetOptions(Options); + EE = builder.create(); if (!EE) { if (!ErrorMsg.empty()) -- 2.7.4