[PATCH] Refactoring of Driver and TargetInfo
Michael Spencer
bigcheesegs at gmail.com
Thu Mar 28 17:03:11 PDT 2013
================
Comment at: lib/Driver/Driver.cpp:33-36
@@ +32,6 @@
+ unsigned numArgs = targetInfo.llvmOptions().size();
+ const char **args = new const char*[numArgs + 2];
+ args[0] = "lld (LLVM option parsing)";
+ for (unsigned i = 0; i != numArgs; ++i)
+ args[i + 1] = targetInfo.llvmOptions()[i];
+ args[numArgs + 1] = 0;
----------------
Shankar Kalpathi Easwaran wrote:
> A memory leak, the function doesnot free the memory on return, do you want to use a BumpAllocator ?
I'm not sure if llvm::cl expects the memory to stay around or not, as argv does. This is what clang currently does also.
http://llvm-reviews.chandlerc.com/D589
BRANCH
svn
ARCANIST PROJECT
lld
More information about the llvm-commits
mailing list