-newGlobalName :: SrcLoc -> Maybe ExportFlag -> Bool{-True<=>value name,False<=>tycon/class-}
- -> RdrName -> RnM_Info s Name
+newGlobalName :: SrcLoc
+ -> Maybe ExportFlag
+ -> Bool{-True<=>value name,False<=>tycon/class-}
+ -> RdrName
+ -> RnM_Info s Name
+
+newGlobalName locn maybe_exp is_val_name (Unqual name)
+ = getExtraRn `thenRn` \ ((b_val_names,b_tc_names),b_keys,rec_exp_fn,rec_occ_fn) ->
+ getModuleRn `thenRn` \ mod ->
+ rnGetUnique `thenRn` \ u ->
+ let
+ orig = OrigName mod name
+
+ (uniq, is_toplev)
+ = case (lookupFM b_keys orig) of
+ Just (key,_) -> (key, True)
+ Nothing -> if not opt_CompilingPrelude then (u,True) else -- really here just to save gratuitous lookup
+ case (lookupFM (if is_val_name then b_val_names else b_tc_names) orig) of
+ Nothing -> (u, True)
+ Just xx -> (uniqueOf xx, False{-builtin!-})