diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix index bc6767e8766e..e2aceb79bfae 100644 --- a/pkgs/development/compilers/llvm/7/clang/default.nix +++ b/pkgs/development/compilers/llvm/7/clang/default.nix @@ -1,6 +1,7 @@ { stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python , fixDarwinDylibNames , enableManpages ? false +, enablePolly ? false # TODO: get this info from llvm (passthru?) }: let @@ -30,6 +31,9 @@ let "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ stdenv.lib.optionals enablePolly [ + "-DWITH_POLLY=ON" + "-DLINK_POLLY_INTO_TOOLS=ON" ]; patches = [ ./purity.patch ]; diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 3f1192d96263..55a177fa1aa6 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -29,10 +29,16 @@ let in { llvm = callPackage ./llvm.nix { }; + llvm-polly = callPackage ./llvm.nix { enablePolly = true; }; clang-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; }; + clang-polly-unwrapped = callPackage ./clang { + inherit clang-tools-extra_src; + llvm = tools.llvm-polly; + enablePolly = true; + }; llvm-manpages = lowPrio (tools.llvm.override { enableManpages = true; diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm.nix index 5bb629931fd5..fa5c48ec3eae 100644 --- a/pkgs/development/compilers/llvm/7/llvm.nix +++ b/pkgs/development/compilers/llvm/7/llvm.nix @@ -16,12 +16,14 @@ , enableManpages ? false , enableSharedLibraries ? true , enablePFM ? !stdenv.isDarwin +, enablePolly ? false }: let inherit (stdenv.lib) optional optionals optionalString; src = fetch "llvm" "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3"; + polly_src = fetch "polly" "0wgvayfilgb530bq51l7szxfb13l24nnrmyji2f6ncq95a24dw8v"; # Used when creating a version-suffixed symlink of libLLVM.dylib shortVersion = with stdenv.lib; @@ -34,6 +36,9 @@ in stdenv.mkDerivation (rec { unpackFile ${src} mv llvm-${version}* llvm sourceRoot=$PWD/llvm + '' + optionalString enablePolly '' + unpackFile ${polly_src} + mv polly-* $sourceRoot/tools/polly ''; outputs = [ "out" "python" ] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d2d2c47eea3d..d529c38ef256 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6684,6 +6684,8 @@ in useMacosReexportHack = true; }; }; + llvm-polly = llvmPackages_7.llvm-polly; + clang-polly = clang_7.override { cc = llvmPackages_7.clang-polly-unwrapped; }; clang_7 = llvmPackages_7.clang; clang_6 = llvmPackages_6.clang;