summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2017-09-06 11:31:01 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-06 11:33:07 -0400
commit22733532171330136d87533d523f565f2a4f102f (patch)
treed399f168096fe203d459fb5fa0fc1210ff05bd4c /configure.ac
parent0cd467b2269595e1ae2bc273c3acf9e14adeb9e7 (diff)
downloadhaskell-22733532171330136d87533d523f565f2a4f102f.tar.gz
Clean up opt and llc
The LLVM backend shells out to LLVMs `opt` and `llc` tools. This clean up introduces a shared data structure to carry the arguments we pass to each tool so that corresponding flags are next to each other. It drops the hard coded data layouts in favor of using `-mtriple` and have LLVM infer them. Furthermore we add `clang` as a proper tool, so we don't rely on assuming that `clang` is called `clang` on the `PATH` when using `clang` as the assembler. Finally this diff also changes the type of `optLevel` from `Int` to `Word`, as we do not have negative optimization levels. Reviewers: erikd, hvr, austin, rwbarton, bgamari, kavon Reviewed By: kavon Subscribers: michalt, Ericson2314, ryantrinkle, dfeuer, carter, simonpj, kavon, simonmar, thomie, erikd, snowleopard Differential Revision: https://phabricator.haskell.org/D3352
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 500be7e491..92b8523023 100644
--- a/configure.ac
+++ b/configure.ac
@@ -637,6 +637,12 @@ AC_SUBST([LlvmVersion])
sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/')
AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The supported LLVM version number])
+dnl ** Which LLVM clang to use?
+dnl --------------------------------------------------------------
+AC_CHECK_TARGET_TOOL([CLANG], [clang])
+ClangCmd="$CLANG"
+AC_SUBST([ClangCmd])
+
dnl ** Which LLVM llc to use?
dnl --------------------------------------------------------------
FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion])
@@ -1324,6 +1330,7 @@ echo "\
xelatex : $XELATEX
Using LLVM tools
+ clang : $ClangCmd
llc : $LlcCmd
opt : $OptCmd"