Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
b4e8611b
Commit
b4e8611b
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-07-20 16:16:34 by sof]
Added paragraph about why _casm_s are a bad idea
parent
bfce9573
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/docs/users_guide/glasgow_exts.vsgml
+22
-1
22 additions, 1 deletion
ghc/docs/users_guide/glasgow_exts.vsgml
with
22 additions
and
1 deletion
ghc/docs/users_guide/glasgow_exts.vsgml
+
22
−
1
View file @
b4e8611b
%
% $Id: glasgow_exts.vsgml,v 1.
1
1998/0
1/30 17:02:18 simonm
Exp $
% $Id: glasgow_exts.vsgml,v 1.
2
1998/0
7/20 16:16:34 sof
Exp $
%
% GHC Language Extensions.
%
...
...
@@ -275,6 +275,27 @@ replaced with the 1st--nth arguments. As you can see above, it is an
easy way to do simple C~casting. Everything said about @_ccall_@ goes
for @_casm_@ as well.
The use of @_casm_@ in your code does pose a problem to the compiler
when it comes to generating an interface file for a freshly compiled
module. Included in an interface file is the unfolding (if any) of a
declaration. However, if a declaration's unfolding happens to contain
a @_casm_@, its unfolding will <em/not/ be emitted into the interface
file even if it qualifies by all the other criteria. The reason why
the compiler prevents this from happening is that unfolding @_casm_@s
into an interface file unduly constrains how code that import your
module have to be compiled. If an imported declaration is unfolded and
it contains a @_casm_@, you now have to be using a compiler backend
capable of dealing with it (i.e., the C compiler backend). If you are
using the C compiler backend, the unfolded @_casm_@ may still cause you
problems since the C code snippet it contains may mention CPP symbols
that were in scope when compiling the original module are not when
compiling the importing module.
If you're willing to put up with the drawbacks of doing cross-module
inlining of C code (GHC - A Better C Compiler :-), the option
@-funfold-casms-in-hi-file@ will turn off the default behaviour.
<nidx>-funfold-casms-in-hi-file option</nidx>
%************************************************************************
%* *
<sect2>Using function headers
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment