Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
ab14d99b
Commit
ab14d99b
authored
Jul 27, 2012
by
Gabor Greif
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GHCConstants.h should not contain preprocessor definitions
parent
c7a7c49a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
includes/mkDerivedConstants.c
includes/mkDerivedConstants.c
+25
-0
No files found.
includes/mkDerivedConstants.c
View file @
ab14d99b
...
...
@@ -79,8 +79,12 @@
field_offset_(str(s_type,field),s_type,field);
/* An access macro for use in C-- sources. */
#if defined(GEN_HASKELL)
#define struct_field_macro(str)
/* nothing */
#else
#define struct_field_macro(str) \
printf("#define " str "(__ptr__) REP_" str "[__ptr__+OFFSET_" str "]\n");
#endif
/* Outputs the byte offset and MachRep for a field */
#define struct_field(s_type, field) \
...
...
@@ -125,8 +129,12 @@
closure_size(s_type)
/* An access macro for use in C-- sources. */
#if defined(GEN_HASKELL)
#define closure_field_macro(str)
/* nothing */
#else
#define closure_field_macro(str) \
printf("#define " str "(__ptr__) REP_" str "[__ptr__+SIZEOF_StgHeader+OFFSET_" str "]\n");
#endif
#define closure_field_offset_(str, s_type,field) \
def_offset(str, OFFSET(s_type,field) - TYPE_SIZE(StgHeader));
...
...
@@ -134,8 +142,12 @@
#define closure_field_offset(s_type,field) \
closure_field_offset_(str(s_type,field),s_type,field)
#if defined(GEN_HASKELL)
#define closure_payload_macro(str)
/* nothing */
#else
#define closure_payload_macro(str) \
printf("#define " str "(__ptr__,__ix__) W_[__ptr__+SIZEOF_StgHeader+OFFSET_" str " + WDS(__ix__)]\n");
#endif
#define closure_payload(s_type,field) \
closure_field_offset_(str(s_type,field),s_type,field); \
...
...
@@ -164,26 +176,39 @@
def_offset(str(s_type,field), OFFSET(s_type,field) - TYPE_SIZE(StgHeader) - TYPE_SIZE(StgTSOProfInfo));
/* Full byte offset for a TSO field, for use from Cmm */
#if defined(GEN_HASKELL)
#define tso_field_offset_macro(str)
/* nothing */
#else
#define tso_field_offset_macro(str) \
printf("#define TSO_OFFSET_" str " (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_" str ")\n");
#endif
#define tso_field_offset(s_type, field) \
tso_payload_offset(s_type, field); \
tso_field_offset_macro(str(s_type,field));
#if defined(GEN_HASKELL)
#define tso_field_macro(str)
/* nothing */
#else
#define tso_field_macro(str) \
printf("#define " str "(__ptr__) REP_" str "[__ptr__+TSO_OFFSET_" str "]\n")
#endif
#define tso_field(s_type, field) \
field_type(s_type, field); \
tso_field_offset(s_type,field); \
tso_field_macro(str(s_type,field))
#if defined(GEN_HASKELL)
#define opt_struct_size(s_type, option)
/* nothing */
#else
#define opt_struct_size(s_type, option) \
printf("#ifdef " #option "\n"); \
printf("#define SIZEOF_OPT_" #s_type " SIZEOF_" #s_type "\n"); \
printf("#else\n"); \
printf("#define SIZEOF_OPT_" #s_type " 0\n"); \
printf("#endif\n\n");
#endif
#define FUN_OFFSET(sym) (OFFSET(Capability,f.sym) - OFFSET(Capability,r))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment