Deleted Added
full compact
ToolChain.cpp (263508) ToolChain.cpp (266715)
1//===--- ToolChain.cpp - Collections of tools for one platform ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 416 unchanged lines hidden (view full) ---

425
426void ToolChain::AddCCKextLibArgs(const ArgList &Args,
427 ArgStringList &CmdArgs) const {
428 CmdArgs.push_back("-lcc_kext");
429}
430
431bool ToolChain::AddFastMathRuntimeIfAvailable(const ArgList &Args,
432 ArgStringList &CmdArgs) const {
1//===--- ToolChain.cpp - Collections of tools for one platform ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 416 unchanged lines hidden (view full) ---

425
426void ToolChain::AddCCKextLibArgs(const ArgList &Args,
427 ArgStringList &CmdArgs) const {
428 CmdArgs.push_back("-lcc_kext");
429}
430
431bool ToolChain::AddFastMathRuntimeIfAvailable(const ArgList &Args,
432 ArgStringList &CmdArgs) const {
433 // Check if -ffast-math or -funsafe-math is enabled.
434 Arg *A = Args.getLastArg(options::OPT_ffast_math,
435 options::OPT_fno_fast_math,
436 options::OPT_funsafe_math_optimizations,
437 options::OPT_fno_unsafe_math_optimizations);
433 // Do not check for -fno-fast-math or -fno-unsafe-math when -Ofast passed
434 // (to keep the linker options consistent with gcc and clang itself).
435 if (!isOptimizationLevelFast(Args)) {
436 // Check if -ffast-math or -funsafe-math.
437 Arg *A =
438 Args.getLastArg(options::OPT_ffast_math, options::OPT_fno_fast_math,
439 options::OPT_funsafe_math_optimizations,
440 options::OPT_fno_unsafe_math_optimizations);
438
441
439 if (!A || A->getOption().getID() == options::OPT_fno_fast_math ||
440 A->getOption().getID() == options::OPT_fno_unsafe_math_optimizations)
441 return false;
442
442 if (!A || A->getOption().getID() == options::OPT_fno_fast_math ||
443 A->getOption().getID() == options::OPT_fno_unsafe_math_optimizations)
444 return false;
445 }
443 // If crtfastmath.o exists add it to the arguments.
444 std::string Path = GetFilePath("crtfastmath.o");
445 if (Path == "crtfastmath.o") // Not found.
446 return false;
447
448 CmdArgs.push_back(Args.MakeArgString(Path));
449 return true;
450}
446 // If crtfastmath.o exists add it to the arguments.
447 std::string Path = GetFilePath("crtfastmath.o");
448 if (Path == "crtfastmath.o") // Not found.
449 return false;
450
451 CmdArgs.push_back(Args.MakeArgString(Path));
452 return true;
453}