Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
e56bb9ed
Commit
e56bb9ed
authored
Mar 14, 1996
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add exception attribute for Windows
From-SVN: r11528
parent
80363f0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
54 deletions
+100
-54
gcc/config/rs6000/rs6000.c
+23
-0
gcc/config/rs6000/win-nt.h
+77
-54
No files found.
gcc/config/rs6000/rs6000.c
View file @
e56bb9ed
...
...
@@ -4368,6 +4368,29 @@ rs6000_valid_type_attribute_p (type, attributes, identifier, args)
pointer. */
if
(
is_attribute_p
(
"dllexport"
,
identifier
))
return
(
args
==
NULL_TREE
);
/* Exception attribute allows the user to specify 1-2 strings or identifiers
that will fill in the 3rd and 4th fields of the structured exception
table. */
if
(
is_attribute_p
(
"exception"
,
identifier
))
{
int
i
;
if
(
args
==
NULL_TREE
)
return
0
;
for
(
i
=
0
;
i
<
2
&&
args
!=
NULL_TREE
;
i
++
)
{
tree
this_arg
=
TREE_VALUE
(
args
);
args
=
TREE_PURPOSE
(
args
);
if
(
TREE_CODE
(
this_arg
)
!=
STRING_CST
&&
TREE_CODE
(
this_arg
)
!=
IDENTIFIER_NODE
)
return
0
;
}
return
(
args
==
NULL_TREE
);
}
}
return
0
;
...
...
gcc/config/rs6000/win-nt.h
View file @
e56bb9ed
...
...
@@ -202,61 +202,84 @@ do { \
#undef ASM_FILE_END
#undef ASM_OUTPUT_FUNCTION_PREFIX
#define ASM_OUTPUT_FUNCTION_PREFIX(FILE,NAME) \
{ \
fprintf (FILE, "\n#\tFunction: '.."); \
assemble_name (FILE, NAME); \
fprintf (FILE, "'\n"); \
fprintf (FILE, "#\tText in section: <%s>\n\n","default"); \
fprintf (FILE, "#\tSetup MS Structured-Exception-Handling\n"); \
fprintf (FILE, "\t.pdata\n"); \
fprintf (FILE, "\t.align 2\n"); \
fprintf (FILE, "\t.ualong .."); \
assemble_name (FILE, NAME); \
fprintf (FILE, ","); \
assemble_name (FILE, NAME); \
fprintf (FILE, ".e,0,0,"); \
assemble_name (FILE, NAME); \
fprintf (FILE, ".b\n\n"); \
fprintf (FILE, "#\tSwitch to the relocation section\n"); \
fprintf (FILE, "\t.reldata\n"); \
}
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
{ \
if (TREE_PUBLIC (DECL)) \
{ \
fprintf (FILE, "\t.globl .."); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} \
assemble_name (FILE, NAME); \
fprintf (FILE, ":\n"); \
fprintf (FILE, "\t.ualong .."); \
assemble_name (FILE, NAME); \
fprintf (FILE, ",.toc\n"); \
\
if (lookup_attribute ("dllexport", \
TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \
{ \
fprintf (FILE, "\t.globl __imp_"); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n__imp_"); \
assemble_name (FILE, NAME); \
fprintf (FILE, ":\n\t.ulong "); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} \
\
fprintf (FILE, "\t.section .text\n\t.align 2\n.."); \
assemble_name (FILE, NAME); \
fprintf (FILE, ":\n"); \
fprintf (FILE, "\t.function\t.."); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
{ \
tree exception_args; \
int i; \
\
if (TREE_PUBLIC (DECL)) \
{ \
fprintf (FILE, "\t.globl .."); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} \
assemble_name (FILE, NAME); \
fprintf (FILE, ":\n"); \
fprintf (FILE, "\t.ualong .."); \
assemble_name (FILE, NAME); \
fprintf (FILE, ",.toc\n"); \
\
fprintf (FILE, "\n#\tFunction: '.."); \
assemble_name (FILE, NAME); \
fputs ("'\n", FILE); \
fputs ("#\tText in section: <default>\n\n", FILE); \
fputs ("#\tSetup MS Structured-Exception-Handling\n", FILE); \
fputs ("\t.pdata\n", FILE); \
fputs ("\t.align 2\n", FILE); \
fputs ("\t.ualong ..", FILE); \
assemble_name (FILE, NAME); \
fputs (",", FILE); \
assemble_name (FILE, NAME); \
fputs (".e,", FILE); \
exception_args = lookup_attribute ("exception", \
TYPE_ATTRIBUTES (TREE_TYPE (DECL))); \
\
if (exception_args) \
exception_args = TREE_VALUE (exception_args); \
\
for (i = 0; i < 2; i++) \
{ \
if (!exception_args) \
fputs ("0,", FILE); \
else \
{ \
tree field = TREE_VALUE (exception_args); \
exception_args = TREE_PURPOSE (exception_args); \
if (TREE_CODE (field) == STRING_CST) \
fprintf (FILE, "%.*s,", TREE_STRING_LENGTH (field), \
TREE_STRING_POINTER (field)); \
else if (TREE_CODE (field) == IDENTIFIER_NODE) \
fprintf (FILE, "%.*s,", IDENTIFIER_LENGTH (field), \
IDENTIFIER_POINTER (field)); \
else \
abort (); \
} \
} \
\
assemble_name (FILE, NAME); \
fprintf (FILE, ".b\n\n"); \
fprintf (FILE, "#\tSwitch to the relocation section\n"); \
fprintf (FILE, "\t.reldata\n"); \
\
if (lookup_attribute ("dllexport", \
TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \
{ \
fprintf (FILE, "\t.globl __imp_"); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n__imp_"); \
assemble_name (FILE, NAME); \
fprintf (FILE, ":\n\t.ulong "); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} \
\
fprintf (FILE, "\t.section .text\n\t.align 2\n.."); \
assemble_name (FILE, NAME); \
fprintf (FILE, ":\n"); \
fprintf (FILE, "\t.function\t.."); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
}
/* This is how to output an assembler line defining a `double' constant. */
...
...
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