Skip to content

Commit 54c30d4

Browse files
committed
Merge remote-tracking branch 'remotes/Daniel-Cortez/__pragma'
# Conflicts: # source/compiler/sc.h # source/compiler/sc1.c # source/compiler/scvars.c
2 parents f3cddf3 + 8c04b0a commit 54c30d4

File tree

6 files changed

+334
-39
lines changed

6 files changed

+334
-39
lines changed

source/compiler/sc.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ enum {
414414
tNATIVE,
415415
tNEW,
416416
tOPERATOR,
417+
t__PRAGMA,
417418
tPUBLIC,
418419
tRETURN,
419420
tSIZEOF,
@@ -585,6 +586,16 @@ enum { /* search types for error_suggest() when the identifier type is "estSYMB
585586
esfVARCONST = esfCONST | esfVARIABLE | esfARRAY
586587
};
587588

589+
enum { /* attribute flags for "__pragma" */
590+
attrDEPRECATED,
591+
attrUNUSED,
592+
attrUNREAD,
593+
attrUNWRITTEN,
594+
attrNODESTRUCT,
595+
attrNAKED,
596+
NUM_ATTRS
597+
};
598+
588599
/* interface functions */
589600
#if defined __cplusplus
590601
extern "C" {
@@ -673,6 +684,9 @@ SC_FUNC symbol *add_builtin_string_constant(char *name,const char *val,int vclas
673684
SC_FUNC void exporttag(int tag);
674685
SC_FUNC void sc_attachdocumentation(symbol *sym);
675686
SC_FUNC void emit_parse_line(void);
687+
SC_FUNC void pragma_deprecated(symbol *sym);
688+
SC_FUNC void pragma_unused(symbol *sym,int unread,int unwritten);
689+
SC_FUNC void pragma_nodestruct(symbol *sym);
676690

677691
/* function prototypes in SC2.C */
678692
#define PUSHSTK_P(v) { stkitem s_; s_.pv=(v); pushstk(s_); }
@@ -974,6 +988,7 @@ SC_VDECL int pc_recursion; /* enable detailed recursion report? */
974988
SC_VDECL int pc_retexpr; /* true if the current expression is a part of a "return" statement */
975989
SC_VDECL int pc_retheap; /* heap space (in bytes) to be manually freed when returning an array returned by another function */
976990
SC_VDECL int pc_nestlevel; /* number of active (open) compound statements */
991+
SC_VDECL unsigned int pc_attributes;/* currently set attribute flags (for the "__pragma" operator) */
977992

978993
SC_VDECL constvalue_root sc_automaton_tab; /* automaton table */
979994
SC_VDECL constvalue_root sc_state_tab; /* state table */

0 commit comments

Comments
 (0)