Commit 470bedbb authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Don't expose the cas definition to .hc files

This is more pleasant than having the C generator check whether the
function it's calling is cas, and not generate a prototype if so.
parent d1bffa69
......@@ -101,7 +101,7 @@ module CLabel (
hasCAF,
infoLblToEntryLbl, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl,
needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel,
isMathFun, isCas,
isMathFun,
isCFunctionLabel, isGcPtrLabel, labelDynamic,
pprCLabel
......@@ -590,14 +590,6 @@ maybeAsmTemp (AsmTempLabel uq) = Just uq
maybeAsmTemp _ = Nothing
-- | Check whether a label corresponds to our cas function.
-- We #include the prototype for this, so we need to avoid
-- generating out own C prototypes.
isCas :: CLabel -> Bool
isCas (CmmLabel pkgId fn _) = pkgId == rtsPackageId && fn == fsLit "cas"
isCas _ = False
-- | Check whether a label corresponds to a C function that has
-- a prototype in a system header somehere, or is built-in
-- to the C compiler. For these labels we avoid generating our
......
......@@ -248,7 +248,7 @@ pprStmt stmt = case stmt of
| CmmNeverReturns <- ret ->
let myCall = pprCall (pprCLabel lbl) cconv results args safety
in (real_fun_proto lbl, myCall)
| not (isMathFun lbl || isCas lbl) ->
| not (isMathFun lbl) ->
let myCall = braces (
pprCFunType (char '*' <> text "ghcFunPtr") cconv results args <> semi
$$ text "ghcFunPtr" <+> equals <+> cast_fn <> semi
......
......@@ -306,6 +306,7 @@ load_load_barrier(void) {
#define store_load_barrier() /* nothing */
#define load_load_barrier() /* nothing */
#if !IN_STG_CODE || IN_STGCRUN
INLINE_HEADER StgWord
xchg(StgPtr p, StgWord w)
{
......@@ -337,6 +338,7 @@ atomic_dec(StgVolatilePtr p)
{
return --(*p);
}
#endif
#define VOLATILE_LOAD(p) ((StgWord)*((StgWord*)(p)))
......
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