X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=nesc.git;a=blobdiff_plain;f=src%2Fmachine%2Fkeil.c;h=cd46abacac89a4eeec7ee3be3fef339071aaff8c;hp=27b9ef2ab78ee637644f61a4e9346fc1b80b3c78;hb=7b54393e237ed8f23c0c74f0a6cbc8de26c5bf98;hpb=57d4530c4d6814fa25338a00cc65b95938c723b6 diff --git a/src/machine/keil.c b/src/machine/keil.c index 27b9ef2..cd46aba 100644 --- a/src/machine/keil.c +++ b/src/machine/keil.c @@ -40,7 +40,12 @@ static int keil_token(const char *token, int len, struct yystype *lvalp) struct keilword *keyword = is_keil_word(token, len); if (keyword) - return keyword->token; + { + lvalp->idtoken.location = last_location(); + lvalp->idtoken.id = make_cstring(parse_region, token, len); + lvalp->idtoken.decl = NULL; + return keyword->token; + } return IDENTIFIER; } @@ -52,7 +57,7 @@ declaration keil_special(location loc, cstring keyword, cstring name, region r = parse_region; /* Build __attribute__((keil_address(address))) */ word aword = new_word(r, loc, str2cstring(r, "keil_address")); - gcc_attribute address_attr = new_gcc_attribute(r, loc, aword, address); + target_attribute address_attr = new_target_attribute(r, loc, aword, address); /* Build a declaration for name */ declarator d = make_identifier_declarator(loc, name); @@ -79,7 +84,7 @@ declaration keil_special(location loc, cstring keyword, cstring name, /* Basic pointer sizes and alignments for the 8051's compiled w/ Keil C51 */ static machine_spec keil_machine = { - "keil", NULL, + "keil51", NULL, TRUE, /* big_endian */ FALSE, /* pcc_bitfield_type_matters */ 8, /* empty field boundary - in bits */ @@ -96,12 +101,14 @@ static machine_spec keil_machine = { 1, 1, 1, 1, /* int1/2/4/8 align */ 2, 2, /* wchar_t, size_t size */ TRUE, TRUE, /* char, wchar_t signed */ + "reentrant", /* attribute for async functions */ NULL, /* adjust_field_align function */ NULL, NULL, NULL, NULL, /* attribute handling functions */ NULL, keil_init, keil_token, keil_special, /* Keil C special */ - NULL, /* global cpp support */ + gcc_global_cpp_init, /* global cpp support: this should be tailored to keil + to get correct behaviour */ NULL /* per-file cpp support */ };