[Git][ghc/ghc][master] 2 commits: llvmGen: Fix built-in variable predicate

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 6e67fa08 by Ben Gamari at 2025-05-08T06:21:21-04:00 llvmGen: Fix built-in variable predicate Previously the predicate to identify LLVM builtin global variables was checking for `$llvm` rather than `@llvm` as it should. - - - - - a9d0a22c by Ben Gamari at 2025-05-08T06:21:22-04:00 llvmGen: Fix linkage of built-in arrays LLVM now insists that built-in arrays use Appending linkage, not Internal. Fixes #25769. - - - - - 2 changed files: - compiler/GHC/CmmToLlvm/Base.hs - compiler/GHC/CmmToLlvm/Data.hs Changes: ===================================== compiler/GHC/CmmToLlvm/Base.hs ===================================== @@ -526,10 +526,10 @@ generateExternDecls = do modifyEnv $ \env -> env { envAliases = emptyUniqSet } return (concat defss, []) --- | Is a variable one of the special @$llvm@ globals? +-- | Is a variable one of the special @\@llvm@ globals? isBuiltinLlvmVar :: LlvmVar -> Bool isBuiltinLlvmVar (LMGlobalVar lbl _ _ _ _ _) = - "$llvm" `isPrefixOf` unpackFS lbl + "llvm." `isPrefixOf` unpackFS lbl isBuiltinLlvmVar _ = False -- | Here we take a global variable definition, rename it with a ===================================== compiler/GHC/CmmToLlvm/Data.hs ===================================== @@ -125,7 +125,7 @@ genGlobalLabelArray var_nm clbls = do prio = LMStaticLit $ LMIntLit 0xffff i32 in LMStaticStrucU [prio, fn, null] entry_ty - arr_var = LMGlobalVar var_nm arr_ty Internal Nothing Nothing Global + arr_var = LMGlobalVar var_nm arr_ty Appending Nothing Nothing Global mkFunTy lbl = LMFunction $ LlvmFunctionDecl lbl ExternallyVisible CC_Ccc LMVoid FixedArgs [] Nothing entry_ty = LMStructU [i32, LMPointer $ mkFunTy $ fsLit "placeholder", LMPointer i8] arr_ty = LMArray (length clbls) entry_ty View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/165f98d86f59b783511f8015dc1e547... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/165f98d86f59b783511f8015dc1e547... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)