On Thu, Feb 12, 2009 at 7:59 PM, Chris Lattner <[email protected]> wrote: > > On Feb 12, 2009, at 4:31 PM, Douglas Gregor wrote: > >> >> On Feb 12, 2009, at 4:29 PM, Daniel Dunbar wrote: >> >>> Author: ddunbar >>> Date: Thu Feb 12 18:29:22 2009 >>> New Revision: 64416 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=64416&view=rev >>> Log: >>> Always pass -disable-free to clang when compiling. >> >> This makes me sad. I found an icky ownership problem a few days ago >> that I would have missed completely if we always passed "-disable- >> free". Since we're moving toward using the driver for *everything*, it >> really seems like we want -disable-free in Release-Asserts builds but >> not in Debug builds. > > How about just doing something like: > > static llvm::cl::opt<bool> > DisableFree("disable-free", > llvm::cl::desc("Disable freeing of memory on exit"), > #ifndef NDEBUG > llvm::cl::init(true) > #else > llvm::cl::init(false) > #endif > ); > > ?
I really don't like this (ironic, I know since Eli complained about exactly the same change I made to CodeGen to toggle assignment of names). In practice I think this leads to mistakes and lost time, it is easy to forget that this change exists when debugging things. The current approach I think is workable while being consistent and allowing us to find ownership bugs sooner rather than later. And using -### or -v with the driver will always make it explicit what is going on, which is a good goal in my opinion. - Daniel > -Chris > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
