clang: lib/Driver/ToolChains/PPCLinux.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

13#include "llvm/Support/FileSystem.h"

14#include "llvm/Support/Path.h"

15

19using namespace llvm::sys;

20

21

22

25

26

27 if (fs::real_path(Linker, Path))

28 return false;

29 llvm::StringRef LinkerName =

30 path::filename(llvm::StringRef(Path.data(), Path.size()));

31

32

33

34 if (LinkerName.starts_with("ld64.so"))

35 return true;

36

37 if (!LinkerName.starts_with("ld-2."))

38 return false;

39 unsigned Minor = (LinkerName[5] - '0') * 10 + (LinkerName[6] - '0');

40 if (Minor < 32)

41 return false;

42

43 return true;

44}

45

47 const llvm::Triple &Triple,

48 const llvm::opt::ArgList &Args)

49 : Linux(D, Triple, Args) {

50 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {

51 StringRef ABIName = A->getValue();

52

53 if ((ABIName == "ieeelongdouble" &&

54 !SupportIEEEFloat128(D, Triple, Args)) ||

55 (ABIName == "ibmlongdouble" && !supportIBMLongDouble(D, Args)))

56 D.Diag(diag::warn_drv_unsupported_float_abi_by_lib) << ABIName;

57 }

58}

59

61 ArgStringList &CC1Args) const {

62 if (!DriverArgs.hasArg(clang::driver::options::OPT_nostdinc) &&

63 !DriverArgs.hasArg(options::OPT_nobuiltininc)) {

66 llvm::sys::path::append(P, "include", "ppc_wrappers");

68 }

69

71}

72

73bool PPCLinuxToolChain::supportIBMLongDouble(

74 const Driver &D, const llvm::opt::ArgList &Args) const {

75 if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx))

76 return true;

77

80 return true;

81

83}

84

85bool PPCLinuxToolChain::SupportIEEEFloat128(

86 const Driver &D, const llvm::Triple &Triple,

87 const llvm::opt::ArgList &Args) const {

88 if (!Triple.isLittleEndian() || !Triple.isPPC64())

89 return false;

90

91 if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx))

92 return true;

93

95 bool HasUnsupportedCXXLib =

99

102 !(D.CCCIsCXX() && HasUnsupportedCXXLib);

103}

static bool GlibcSupportsFloat128(const std::string &Linker)

Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...