mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-20 01:20:32 +00:00
Clean up the clone() code a bit
This commit is contained in:
parent
ce71677156
commit
2743f3d012
20 changed files with 252 additions and 150 deletions
1
third_party/chibicc/parse.c
vendored
1
third_party/chibicc/parse.c
vendored
|
@ -559,6 +559,7 @@ static Token *thing_attributes(Token *tok, void *arg) {
|
|||
consume_attribute(&tok, tok, "warn_unused_result") ||
|
||||
consume_attribute(&tok, tok, "flatten") ||
|
||||
consume_attribute(&tok, tok, "leaf") ||
|
||||
consume_attribute(&tok, tok, "no_reorder") ||
|
||||
consume_attribute(&tok, tok, "dontthrow") ||
|
||||
consume_attribute(&tok, tok, "optnone") ||
|
||||
consume_attribute(&tok, tok, "returns_twice") ||
|
||||
|
|
8
third_party/chibicc/preprocess.c
vendored
8
third_party/chibicc/preprocess.c
vendored
|
@ -1174,6 +1174,14 @@ __INT_FAST32_TYPE__\000\
|
|||
int\000\
|
||||
__UINT_FAST32_TYPE__\000\
|
||||
unsigned\000\
|
||||
__INT_FAST8_MAX__\000\
|
||||
0x7f\000\
|
||||
__INT_FAST16_MAX__\000\
|
||||
0x7fffffff\000\
|
||||
__INT_FAST32_MAX__\000\
|
||||
0x7fffffff\000\
|
||||
__INT_FAST64_MAX__\000\
|
||||
0x7fffffffffffffffl\000\
|
||||
__INT_FAST64_TYPE__\000\
|
||||
long\000\
|
||||
__UINT_FAST64_TYPE__\000\
|
||||
|
|
4
third_party/chibicc/type.c
vendored
4
third_party/chibicc/type.c
vendored
|
@ -1,3 +1,4 @@
|
|||
#include "libc/assert.h"
|
||||
#include "third_party/chibicc/chibicc.h"
|
||||
|
||||
/* TODO(jart): Why can't these be const? */
|
||||
|
@ -144,6 +145,9 @@ static Type *get_common_type(Type *ty1, Type *ty2) {
|
|||
//
|
||||
// This operation is called the "usual arithmetic conversion".
|
||||
static void usual_arith_conv(Node **lhs, Node **rhs) {
|
||||
if (!(*lhs)->ty || !(*rhs)->ty) {
|
||||
error_tok((*lhs)->tok, "internal npe error");
|
||||
}
|
||||
Type *ty = get_common_type((*lhs)->ty, (*rhs)->ty);
|
||||
*lhs = new_cast(*lhs, ty);
|
||||
*rhs = new_cast(*rhs, ty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue