projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d992bfc
)
Use maybePrefixMatch in StaticFlags rather than redefining it ourselves
author
Ian Lynagh
<igloo@earth.li>
Sat, 14 Jun 2008 19:05:05 +0000
(19:05 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sat, 14 Jun 2008 19:05:05 +0000
(19:05 +0000)
compiler/main/StaticFlags.hs
patch
|
blob
|
history
diff --git
a/compiler/main/StaticFlags.hs
b/compiler/main/StaticFlags.hs
index
534c3d2
..
8d88037
100644
(file)
--- a/
compiler/main/StaticFlags.hs
+++ b/
compiler/main/StaticFlags.hs
@@
-251,7
+251,7
@@
lookUp sw = sw `elem` packed_static_opts
-- (lookup_str "foo") looks for the flag -foo=X or -fooX,
-- and returns the string X
lookup_str sw
-- (lookup_str "foo") looks for the flag -foo=X or -fooX,
-- and returns the string X
lookup_str sw
- = case firstJust (map (startsWith sw) staticFlags) of
+ = case firstJust (map (maybePrefixMatch sw) staticFlags) of
Just ('=' : str) -> Just str
Just str -> Just str
Nothing -> Nothing
Just ('=' : str) -> Just str
Just str -> Just str
Nothing -> Nothing
@@
-451,19
+451,6
@@
isStaticFlag f =
"funfolding-keeness-factor"
]
"funfolding-keeness-factor"
]
-
-
--- Misc functions for command-line options
-
-startsWith :: String -> String -> Maybe String
--- startsWith pfx (pfx++rest) = Just rest
-
-startsWith [] str = Just str
-startsWith (c:cs) (s:ss)
- = if c /= s then Nothing else startsWith cs ss
-startsWith _ [] = Nothing
-
-
-----------------------------------------------------------------------------
-- convert sizes like "3.5M" into integers
-----------------------------------------------------------------------------
-- convert sizes like "3.5M" into integers