Closed axic closed 7 years ago
Thank you @axic. But why make a separate PR?
This was a bugfix, the other one was a feature, wasn't sure the other one would be accepted soon.
I see.
But perhaps I did not make myself clear when explaining. As long as you never wanted to use mod_name
later, which the code did not want to do before it was fine. Not really a bug as mod_name
was just a temporary variable meant to only be passed into LLVM and then never be used again.
The moment you needed to use it again the RFS
scope needed to move further which is what this commit achieved.
I did had function_end
in every DEBUG output though, so that was a bug in my opinion.
oh you did? In that case it would be a bug yes but it would also be rather strange and may signify another problem. Unless LLVMModuleCreateWithNameInContext()
does not make a deep copy.
llvm-c
is rather under-documented so I can't say for sure but I had gathered from my research that they always make a deep copy of the c strings passed to them.
@axic Argghhh! No I see it now. It was a bug yes! mod_name
was also used in bllvm_mod_debug()
just above your addition.
mod_name
was also used inbllvm_mod_debug()
just above your addition.
Yep, hence my reason for this PR :)
Explanation: https://github.com/refu-lang/refu/pull/40#discussion_r103035526