Commit 96dc041a authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Systools.hs: Improve detection of GCC and Clang

Test Plan: Build on Debian using `--with-gcc=clang`

Reviewers: austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1336

GHC Trac Issues: #10981
parent 2b25a589
......@@ -881,10 +881,10 @@ getCompilerInfo' dflags = do
-- Try to grab the info from the process output.
parseCompilerInfo _stdo stde _exitc
-- Regular GCC
| any ("gcc version" `isPrefixOf`) stde =
| any ("gcc version" `isInfixOf`) stde =
return GCC
-- Regular clang
| any ("clang version" `isPrefixOf`) stde =
| any ("clang version" `isInfixOf`) stde =
return Clang
-- XCode 5.1 clang
| any ("Apple LLVM version 5.1" `isPrefixOf`) stde =
......
......@@ -959,7 +959,7 @@ trimAvail :: AvailInfo -> Name -> AvailInfo
trimAvail (Avail n) _ = Avail n
trimAvail (AvailTC n ns fs) m = case find ((== m) . flSelector) fs of
Just x -> AvailTC n [] [x]
Nothing -> ASSERT (m `elem` ns) AvailTC n [m] []
Nothing -> ASSERT(m `elem` ns) AvailTC n [m] []
-- | filters 'AvailInfo's by the given predicate
filterAvails :: (Name -> Bool) -> [AvailInfo] -> [AvailInfo]
......
......@@ -1451,7 +1451,7 @@ disambiguateRecordBinds record_expr rbnds res_ty
lookupParent :: GlobalRdrElt -> RnM (TyCon, GlobalRdrElt)
lookupParent gre = do { id <- tcLookupId (gre_name gre)
; ASSERT (isRecordSelector id)
; ASSERT(isRecordSelector id)
return (recordSelectorTyCon id, gre) }
-- Make all the fields unambiguous by choosing the given parent.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment