diff --git a/src/parsers/nothing.c b/src/parsers/nothing.c index 3ec425dfa278e23be0dd310c4e3add91140783fe..ed0a4060c850d16aa429ad83d76f974b7d6c4875 100644 --- a/src/parsers/nothing.c +++ b/src/parsers/nothing.c @@ -33,8 +33,7 @@ static bool nothing_llvm(HLLVMParserCompileContext *ctxt, /* Allocator */ HAllocator *mm__; /* Names */ - char *nothing_entry_bb_name = NULL; - int nothing_entry_bb_name_len = 0; + H_LLVM_DECLARE_NAME(nothing); /* Nothing entry bb */ LLVMBasicBlockRef entry; /* Nothing result */ @@ -48,11 +47,8 @@ static bool nothing_llvm(HLLVMParserCompileContext *ctxt, mm__ = ctxt->mm__; /* This one just always returns NULL */ - nothing_entry_bb_name_len = snprintf(NULL, 0, "nothing_entry_%p", p); - nothing_entry_bb_name = h_new(char, nothing_entry_bb_name_len + 1); - snprintf(nothing_entry_bb_name, nothing_entry_bb_name_len + 1, - "nothing_entry_%p", p); - entry = LLVMAppendBasicBlock(ctxt->func, nothing_entry_bb_name); + H_LLVM_COMPUTE_NAME(nothing, p); + entry = LLVMAppendBasicBlock(ctxt->func, nothing_name); LLVMBuildBr(ctxt->builder, entry); LLVMPositionBuilderAtEnd(ctxt->builder, entry); rv = LLVMConstNull(ctxt->llvm_parseresultptr); @@ -60,10 +56,8 @@ static bool nothing_llvm(HLLVMParserCompileContext *ctxt, /* Pass it back out */ *res = rv; - if (nothing_entry_bb_name) { - h_free(nothing_entry_bb_name); - nothing_entry_bb_name = NULL; - } + /* Free names */ + H_LLVM_FREE_NAME(nothing); return true; }