[Chapel Merge] Halve memory leaks in compiler

Branch: refs/heads/main
Revision: 590e91b
Author: aconsroe-hpe
Log Message:

Merge pull request #18515 from aconsroe-hpe/memoryleaks-1

Halve memory leaks in compiler

reviewed by @mppf

Found these while looking for allocation hotspots. Not critical but worth fixing while I was there.

Before: total memory leaked: 12.95M
After: total memory leaked: 6.14M

Modified Files:
M compiler/codegen/codegen.cpp

M compiler/include/codegen.h
M compiler/llvm/clangUtil.cpp
M compiler/next/lib/queries/Context.cpp
M compiler/resolution/lifetime.cpp
M compiler/util/misc.cpp

Compare: https://github.com/chapel-lang/chapel/compare/23edaa889a07...590e91b4df98