David Eichmann pushed to branch wip/dcoutts/foreign-label-source-refactoring at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • compiler/GHC/Parser/PostProcess.hs
    ... ... @@ -3321,18 +3321,18 @@ parsePrimImportStr str =
    3321 3321
           -- ""
    
    3322 3322
           ((Nothing, Nothing) <$ skipSpaces) +++
    
    3323 3323
           -- "cmmid"
    
    3324
    -      ((\() cmmid () -> (Nothing, Just cmmid))
    
    3325
    -        <$> sp
    
    3324
    +      ((\cmmid -> (Nothing, Just cmmid))
    
    3325
    +        <$ sp
    
    3326 3326
             <*> parse_cmmid
    
    3327
    -        <*> sp
    
    3327
    +        <* sp
    
    3328 3328
           ) +++
    
    3329 3329
           -- "packageName cmmid"
    
    3330
    -      ((\() pkgname () cmmid () -> (Just pkgname, Just cmmid))
    
    3331
    -        <$> sp
    
    3330
    +      ((\pkgname cmmid -> (Just pkgname, Just cmmid))
    
    3331
    +        <$ sp
    
    3332 3332
             <*> parse_pkgname
    
    3333
    -        <*> sp
    
    3333
    +        <* sp
    
    3334 3334
             <*> parse_cmmid
    
    3335
    -        <*> sp
    
    3335
    +        <* sp
    
    3336 3336
           )
    
    3337 3337
     
    
    3338 3338
         parse_cmmid = (:) <$> satisfy cmmid_first_char
    

  • compiler/GHC/Types/ForeignCall.hs
    ... ... @@ -394,6 +394,10 @@ instance Outputable CLabelTargetLibrary where
    394 394
     data StaticTargetGhc = StaticTargetGhc
    
    395 395
       { staticTargetLabel :: SourceText
    
    396 396
       , staticTargetUnit  :: CLabelTargetLibrary
    
    397
    +    -- ^ What package the static target is in.
    
    398
    +    -- Foreign prim imports (CMM) should always use CLabelTargetInUnit.
    
    399
    +    -- Other user defined foreign imports always use CLabelTargetUnknown unless a
    
    400
    +    -- wrapper functin is generated e.g. in the case of capi and dynamic.
    
    397 401
       }
    
    398 402
       deriving (Data, Eq)
    
    399 403