From 85bbc8126e1a7c8703d99afe3678ad067ca773a8 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 10 Mar 2010 15:34:52 +0100 Subject: [PATCH] Use the list of builtin functions for inlining. Previously a small, fixed list of functions was used for inlining. Now we use the full list of builtin functions instead. --- "c\316\273ash/CLasH/Normalize/NormalizeTools.hs" | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" index a291ccc..b9f4544 100644 --- "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" +++ "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" @@ -24,6 +24,7 @@ import qualified Type -- Local imports import CLasH.Normalize.NormalizeTypes import CLasH.Translator.TranslatorTypes +import CLasH.VHDL.Constants (builtinIds) import CLasH.Utils import qualified CLasH.Utils.Core.CoreTools as CoreTools import qualified CLasH.VHDL.VHDLTools as VHDLTools @@ -195,14 +196,11 @@ is_local_var _ = return False isUserDefined :: CoreSyn.CoreBndr -> Bool -- System names are certain to not be user defined isUserDefined bndr | Name.isSystemName (Id.idName bndr) = False --- Check a list of typical compiler-defined names -isUserDefined bndr = str `notElem` compiler_names +-- Builtin functions are usually not user-defined either (and would +-- break currently if they are...) +isUserDefined bndr = str `notElem` builtinIds where str = Name.getOccString bndr - -- These are names of bindings usually generated by the compiler. For some - -- reason these are not marked as system, probably because the name itself - -- is not made up by the compiler, just this particular binding is. - compiler_names = ["fromInteger", "head", "tail", "init", "last", "+", "*", "-", "!"] -- Is the given binder normalizable? This means that its type signature can be -- represented in hardware, which should (?) guarantee that it can be made -- 2.30.2