mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Minor fixes.
This commit is contained in:
@@ -52,6 +52,14 @@ macro void printf_register_to_string($Type)
|
||||
printf_register($Type.typeid, (PrintFunction)&$Type.to_string);
|
||||
}
|
||||
|
||||
static initialize @priority(101)
|
||||
{
|
||||
if (!print_functions.table.len)
|
||||
{
|
||||
print_functions.init(512);
|
||||
}
|
||||
}
|
||||
|
||||
fn void printf_register(typeid type, PrintFunction function)
|
||||
{
|
||||
if (!print_functions.table.len)
|
||||
|
||||
@@ -50,6 +50,7 @@ fn bool HashMap.is_empty(HashMap* map) @inline
|
||||
|
||||
fn Value*! HashMap.get_ref(HashMap* map, Key key)
|
||||
{
|
||||
if (!map.count) return SearchResult.MISSING!;
|
||||
uint hash = rehash(key.hash());
|
||||
for (Entry *e = map.table[index_for(hash, map.table.len)]; e != null; e = e.next)
|
||||
{
|
||||
|
||||
@@ -360,7 +360,11 @@ static inline bool scan_ident(Lexer *lexer, TokenType normal, TokenType const_to
|
||||
if (!type)
|
||||
{
|
||||
if (!prefix && len == 1) return return_token(lexer, TOKEN_UNDERSCORE, "_");
|
||||
add_error_token(lexer, "An identifier may not consist of only '_' characters.");
|
||||
if (prefix && len == 1)
|
||||
{
|
||||
return add_error_token(lexer, "An identifier was expected after the '%c'.", prefix);
|
||||
}
|
||||
return add_error_token(lexer, "An identifier may not consist of only '_' characters.");
|
||||
}
|
||||
const char* interned_string = symtab_add(lexer->lexing_start, len, hash, &type);
|
||||
if (type == TOKEN_RETURN && lexer->mode == LEX_DOCS) type = TOKEN_IDENT;
|
||||
|
||||
@@ -682,9 +682,6 @@ void llvm_emit_function_decl(GenContext *c, Decl *decl)
|
||||
|
||||
LLVMValueRef function = llvm_get_ref(c, decl);
|
||||
decl->backend_ref = function;
|
||||
printf("-%p-%s\n", function, decl->name);
|
||||
printf("%s", LLVMPrintValueToString(function));
|
||||
printf("---\n");
|
||||
FunctionPrototype *prototype = decl->type->function.prototype;
|
||||
|
||||
ABIArgInfo *ret_abi_info = prototype->ret_abi_info;
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.3.63"
|
||||
#define COMPILER_VERSION "0.3.64"
|
||||
Reference in New Issue
Block a user