Compare commits
No commits in common. "9adcfd2ff5a407eaf6da25561d77546bbff931ac" and "b204860b2e52d6108134cca8bb7b9f3380da4a90" have entirely different histories.
9adcfd2ff5
...
b204860b2e
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,9 +1,9 @@
|
|||||||
a.out
|
a.out
|
||||||
|
tests/*.o
|
||||||
tests/*.asm
|
tests/*.asm
|
||||||
ntc
|
ntc
|
||||||
ntc.exe
|
ntc.exe
|
||||||
*.o
|
*.o
|
||||||
*.d
|
|
||||||
*.err
|
*.err
|
||||||
dos4gw.exe
|
dos4gw.exe
|
||||||
massif.out.*
|
massif.out.*
|
||||||
|
2
Makefile
2
Makefile
@ -22,6 +22,6 @@ install: ntc
|
|||||||
mv ./ntc $(PREFIX)/bin
|
mv ./ntc $(PREFIX)/bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ./ntc $(OBJECTS)
|
rm ./ntc
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
@ -396,10 +396,6 @@ static void ast_usedef_pass(AST *tlc, AST *a, AST *wholestmt) {
|
|||||||
if(a->stmtReturn.val) {
|
if(a->stmtReturn.val) {
|
||||||
ast_usedef_pass(tlc, a->stmtReturn.val, wholestmt);
|
ast_usedef_pass(tlc, a->stmtReturn.val, wholestmt);
|
||||||
}
|
}
|
||||||
} else if (a->nodeKind == AST_EXPR_EXT_SIZEOF) {
|
|
||||||
if (a->exprExtSizeOf.ofExpr) {
|
|
||||||
ast_usedef_pass(tlc, a->exprExtSizeOf.ofExpr, wholestmt);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
stahp_node(a, "ast_usedef_pass: unhandled %s", AST_KIND_STR[a->nodeKind]);
|
stahp_node(a, "ast_usedef_pass: unhandled %s", AST_KIND_STR[a->nodeKind]);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include<stdlib.h>
|
#include<stdlib.h>
|
||||||
#include<stdarg.h>
|
#include<stdarg.h>
|
||||||
#include<stdio.h>
|
#include<stdio.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
inline static size_t djb2(const char *str) {
|
inline static size_t djb2(const char *str) {
|
||||||
size_t hash = 5381;
|
size_t hash = 5381;
|
||||||
@ -55,11 +54,4 @@ __attribute__((format(printf, 1, 2))) static inline char *malp(const char *fmt,
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int is_str_equal_check_null(const char *s1, const char *s2) {
|
|
||||||
if (!s1 || !s2) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return !strcmp(s1, s2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -333,7 +333,7 @@ void cg_chunk(CGState *cg, AST *a) {
|
|||||||
|
|
||||||
} else if(s->nodeKind == AST_STMT_ASSIGN) {
|
} else if(s->nodeKind == AST_STMT_ASSIGN) {
|
||||||
|
|
||||||
if(s->stmtAssign.to && is_xop(s->stmtAssign.what) == XOP_NOT_MEM && is_xop(s->stmtAssign.to) == XOP_NOT_MEM && is_str_equal_check_null(xop(cg->tlc, s->stmtAssign.what), xop(cg->tlc, s->stmtAssign.to))) {
|
if(s->stmtAssign.to && is_xop(s->stmtAssign.what) == XOP_NOT_MEM && is_xop(s->stmtAssign.to) == XOP_NOT_MEM && !strcmp(xop(cg->tlc, s->stmtAssign.what), xop(cg->tlc, s->stmtAssign.to))) {
|
||||||
// It's a noop
|
// It's a noop
|
||||||
} else if(s->stmtAssign.to) {
|
} else if(s->stmtAssign.to) {
|
||||||
if(x86_imul_supported() && s->stmtAssign.to->nodeKind == AST_EXPR_BINARY_OP && s->stmtAssign.to->exprBinOp.operator == BINOP_MUL) {
|
if(x86_imul_supported() && s->stmtAssign.to->nodeKind == AST_EXPR_BINARY_OP && s->stmtAssign.to->exprBinOp.operator == BINOP_MUL) {
|
||||||
|
@ -463,7 +463,7 @@ static bool is_double_field_access(AST *e) {
|
|||||||
static void denoop_visitor(AST **nptr, AST *stmt, AST *stmtPrev, AST *chunk, AST *tlc, void *ud) {
|
static void denoop_visitor(AST **nptr, AST *stmt, AST *stmtPrev, AST *chunk, AST *tlc, void *ud) {
|
||||||
struct DenoopState *state = ud;
|
struct DenoopState *state = ud;
|
||||||
|
|
||||||
// if(state->targetTLC != tlc) return;
|
if(state->targetTLC != tlc) return;
|
||||||
|
|
||||||
AST *n = *nptr;
|
AST *n = *nptr;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user