[cfe-commits] r90127 - in /cfe/trunk: include/clang/CodeGen/CodeGenOptions.h include/clang/Driver/CC1Options.td lib/Driver/CC1Options.cpp lib/Driver/Tools.cpp lib/Frontend/Backend.cpp lib/Frontend/CompilerInvocation.cpp tools/clang-cc/Options.cpp
Daniel Dunbar
daniel at zuster.org
Mon Nov 30 00:42:01 PST 2009
Author: ddunbar
Date: Mon Nov 30 02:42:00 2009
New Revision: 90127
URL: http://llvm.org/viewvc/llvm-project?rev=90127&view=rev
Log:
Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.
Modified:
cfe/trunk/include/clang/CodeGen/CodeGenOptions.h
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/lib/Driver/CC1Options.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Frontend/Backend.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/tools/clang-cc/Options.cpp
Modified: cfe/trunk/include/clang/CodeGen/CodeGenOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CodeGen/CodeGenOptions.h?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/include/clang/CodeGen/CodeGenOptions.h (original)
+++ cfe/trunk/include/clang/CodeGen/CodeGenOptions.h Mon Nov 30 02:42:00 2009
@@ -29,7 +29,7 @@
OnlyAlwaysInlining // Only run the always inlining pass.
};
- unsigned AsmVerbose : 1; /// -dA, -fverbose-asm
+ unsigned AsmVerbose : 1; /// -dA, -fverbose-asm.
unsigned DebugInfo : 1; /// Should generate deubg info (-g).
unsigned DisableFPElim : 1; /// Set when -fomit-frame-pointer is enabled.
unsigned DisableLLVMOpts : 1; /// Don't run any optimizations, for use in
@@ -43,6 +43,7 @@
unsigned NoZeroInitializedInBSS : 1; /// -fno-zero-initialized-in-bss
unsigned OptimizationLevel : 3; /// The -O[0-4] option specified.
unsigned OptimizeSize : 1; /// If -Os is specified.
+ unsigned SoftFloat : 1; /// -soft-float.
unsigned TimePasses : 1; /// Set when -ftime-report is enabled.
unsigned UnitAtATime : 1; /// Unused. For mirroring GCC optimization
/// selection.
@@ -54,8 +55,12 @@
/// The code model to use (-mcmodel).
std::string CodeModel;
+ /// Enable additional debugging information.
std::string DebugPass;
+ /// The ABI to use for passing floating point arguments.
+ std::string FloatABI;
+
/// The float precision limit to use, if non-empty.
std::string LimitFloatPrecision;
@@ -84,6 +89,7 @@
OptimizationLevel = 0;
OptimizeSize = 0;
UnrollLoops = 0;
+ SoftFloat = 0;
TimePasses = 0;
UnitAtATime = 1;
UnwindTables = 0;
Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Mon Nov 30 02:42:00 2009
@@ -117,10 +117,14 @@
HelpText<"Enable additional debug output">;
def mdisable_fp_elim : Flag<"-mdisable-fp-elim">,
HelpText<"Disable frame pointer elimination optimization">;
+def mfloat_abi : Flag<"-mfloat-abi">,
+ HelpText<"The float ABI to use">;
def mlimit_float_precision : Separate<"-mlimit-float-precision">,
HelpText<"Limit float precision to the given value">;
def mno_zero_initialized_in_bss : Flag<"-mno-zero-initialized-in-bss">,
HelpText<"Do not put zero initialized data in the BSS">;
+def msoft_float : Separate<"-msoft-float">,
+ HelpText<"Use software floating point">;
def mrelocation_model : Separate<"-mrelocation-model">,
HelpText<"The relocation model to use">;
def munwind_tables : Flag<"-munwind-tables">,
Modified: cfe/trunk/lib/Driver/CC1Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CC1Options.cpp?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/CC1Options.cpp (original)
+++ cfe/trunk/lib/Driver/CC1Options.cpp Mon Nov 30 02:42:00 2009
@@ -184,8 +184,10 @@
Opts.CodeModel = getLastArgValue(Args, OPT_mcode_model);
Opts.DebugPass = getLastArgValue(Args, OPT_mdebug_pass);
Opts.DisableFPElim = Args.hasArg(OPT_mdisable_fp_elim);
+ Opts.FloatABI = getLastArgValue(Args, OPT_mfloat_abi);
Opts.LimitFloatPrecision = getLastArgValue(Args, OPT_mlimit_float_precision);
Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss);
+ Opts.SoftFloat = Args.hasArg(OPT_msoft_float);
Opts.UnwindTables = Args.hasArg(OPT_munwind_tables);
Opts.RelocationModel = getLastArgValue(Args, OPT_mrelocation_model, "pic");
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Nov 30 02:42:00 2009
@@ -418,15 +418,15 @@
// Floating point operations and argument passing are soft.
//
// FIXME: This changes CPP defines, we need -target-soft-float.
- CmdArgs.push_back("-soft-float");
- CmdArgs.push_back("-float-abi=soft");
+ CmdArgs.push_back("-msoft-float");
+ CmdArgs.push_back("-mfloat-abi=soft");
} else if (FloatABI == "softfp") {
// Floating point operations are hard, but argument passing is soft.
- CmdArgs.push_back("-float-abi=soft");
+ CmdArgs.push_back("-mfloat-abi=soft");
} else {
// Floating point operations and argument passing are hard.
assert(FloatABI == "hard" && "Invalid float abi!");
- CmdArgs.push_back("-float-abi=hard");
+ CmdArgs.push_back("-mfloat-abi=hard");
}
}
Modified: cfe/trunk/lib/Frontend/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Backend.cpp?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Backend.cpp (original)
+++ cfe/trunk/lib/Frontend/Backend.cpp Mon Nov 30 02:42:00 2009
@@ -231,12 +231,18 @@
}
if (CodeGenOpts.DisableFPElim)
BackendArgs.push_back("-disable-fp-elim");
+ if (!CodeGenOpts.FloatABI.empty()) {
+ BackendArgs.push_back("-float-abi");
+ BackendArgs.push_back(CodeGenOpts.FloatABI.c_str());
+ }
if (!CodeGenOpts.LimitFloatPrecision.empty()) {
BackendArgs.push_back("-limit-float-precision");
BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str());
}
if (CodeGenOpts.NoZeroInitializedInBSS)
BackendArgs.push_back("-nozero-initialized-in-bss");
+ if (CodeGenOpts.SoftFloat)
+ BackendArgs.push_back("-soft-float");
BackendArgs.push_back("-relocation-model");
BackendArgs.push_back(CodeGenOpts.RelocationModel.c_str());
if (llvm::TimePassesIsEnabled)
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Nov 30 02:42:00 2009
@@ -134,12 +134,18 @@
}
if (Opts.DisableFPElim)
Res.push_back("-mdisable-fp-elim");
+ if (!Opts.FloatABI.empty()) {
+ Res.push_back("-mfloat-abi");
+ Res.push_back(Opts.FloatABI);
+ }
if (!Opts.LimitFloatPrecision.empty()) {
Res.push_back("-mlimit-float-precision");
Res.push_back(Opts.LimitFloatPrecision);
}
if (Opts.NoZeroInitializedInBSS)
Res.push_back("-mno-zero-initialized-bss");
+ if (Opts.SoftFloat)
+ Res.push_back("-msoft-float");
if (Opts.UnwindTables)
Res.push_back("-munwind-tables");
if (Opts.RelocationModel != "pic") {
Modified: cfe/trunk/tools/clang-cc/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.cpp?rev=90127&r1=90126&r2=90127&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/Options.cpp (original)
+++ cfe/trunk/tools/clang-cc/Options.cpp Mon Nov 30 02:42:00 2009
@@ -155,6 +155,9 @@
llvm::cl::desc("Disable frame pointer elimination optimization"));
static llvm::cl::opt<std::string>
+MFloatABI("mfloat-abi", llvm::cl::desc("The float ABI to use"));
+
+static llvm::cl::opt<std::string>
MLimitFloatPrecision("mlimit-float-precision",
llvm::cl::desc("Limit float precision to the given value"));
@@ -162,6 +165,9 @@
MNoZeroInitializedInBSS("mno-zero-initialized-in-bss",
llvm::cl::desc("Do not put zero initialized data in the BSS"));
+static llvm::cl::opt<bool>
+MSoftFloat("msoft-float", llvm::cl::desc("Use software floating point"));
+
static llvm::cl::opt<std::string>
MRelocationModel("mrelocation-model",
llvm::cl::desc("The relocation model to use"),
@@ -821,10 +827,12 @@
Opts.CodeModel = MCodeModel;
Opts.DebugPass = MDebugPass;
Opts.DisableFPElim = MDisableFPElim;
+ Opts.FloatABI = MFloatABI;
Opts.LimitFloatPrecision = MLimitFloatPrecision;
Opts.NoZeroInitializedInBSS = MNoZeroInitializedInBSS;
- Opts.UnwindTables = MUnwindTables;
+ Opts.SoftFloat = MSoftFloat;
Opts.RelocationModel = MRelocationModel;
+ Opts.UnwindTables = MUnwindTables;
#ifdef NDEBUG
Opts.VerifyModule = 0;
More information about the cfe-commits
mailing list