[llvm-commits] sizeof
Chris Lattner
clattner at apple.com
Wed Sep 5 09:40:21 PDT 2007
> Here is my first attempt at a patch.
> It introduces a new header file where
> people can put templates to be used wherever.
> I have put "endof" and "lengthof"
> which replace most uses of sizeof.
> This should make the code a little neater.
This is a nifty idea. Some specific requests:
1. Please merge this into the existing STLExtras.h header. I don't
think we need to introduce a new header just for these little helpers.
2. All the .cpp files already are 'using namespace llvm', so they
don't need the llvm:: qualifier.
3. Removing the qualifiers make it non-obvious what these do. Please
rename them to array_endof and array_lengthof.
I agree with you that this makes the code significantly nicer,
particularly for endof :)
-Chris
More information about the llvm-commits
mailing list