X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fcmm%2FCmmParse.y;h=579df5e8ab21d4feb37710111b2e6cd57903fdab;hb=d55027c917a101692ded11b6b1421052866df2d4;hp=fa822f60a4f6552f65fd75e1461d862938a4f601;hpb=1e15be89f436ae0a8ad0c2ca4fbf949c8f2c6cfc;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index fa822f6..579df5e 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -294,7 +294,7 @@ decl :: { ExtCode } | STRING type names ';' {% do k <- parseKind $1; return $ mapM_ (newLocal k $2) $3 } - | 'import' names ';' { return () } -- ignore imports + | 'import' names ';' { mapM_ newImport $2 } | 'export' names ';' { return () } -- ignore exports names :: { [FastString] } @@ -793,6 +793,13 @@ newLocal kind ty name = do addVarDecl name (CmmReg (CmmLocal reg)) return reg +-- Creates a foreign label in the import. CLabel's labelDynamic +-- classifies these labels as dynamic, hence the code generator emits the +-- PIC code for them. +newImport :: FastString -> ExtFCode () +newImport name = + addVarDecl name (CmmLit (CmmLabel (mkForeignLabel name Nothing True))) + newLabel :: FastString -> ExtFCode BlockId newLabel name = do u <- code newUnique