Instead of just upcasing them, can we add prefix ARCH_? --Venkatraman On Tue, Aug 25, 2009 at 2:36 AM, Eric Christopher<echristo at apple.com> wrote:> > On Aug 25, 2009, at 12:32 AM, Daniel Dunbar wrote: > >> Hi, >> >> I think I should rename the constants to be a little less likely to >> collide. I think just upcasing them might be good enough? > > It should, this is the pattern generally emitted by all of the backends. > >>>> >>>> $ cpp -dM /dev/null | grep sparc >>>> #define sparc 1 >>>> #define __sparc__ 1 >>>> #define __sparc 1 > > There's likely an all uppercase one as well, but afaik no camel case one. > > -eric >
On Aug 25, 2009, at 7:49 AM, Venkatraman Govindaraju wrote:> Instead of just upcasing them, can we add prefix ARCH_?Works for me :) -eric
I would prefer not to; they already live in a protected namespace, so there is no need to mangle them except to protect them from exuberant preprocessor defines, and this would be slightly out of style with other public uses of enumerations in LLVM. - Daniel On Tue, Aug 25, 2009 at 7:49 AM, Venkatraman Govindaraju<venkatra at cs.wisc.edu> wrote:> Instead of just upcasing them, can we add prefix ARCH_? > > --Venkatraman > > On Tue, Aug 25, 2009 at 2:36 AM, Eric Christopher<echristo at apple.com> wrote: >> >> On Aug 25, 2009, at 12:32 AM, Daniel Dunbar wrote: >> >>> Hi, >>> >>> I think I should rename the constants to be a little less likely to >>> collide. I think just upcasing them might be good enough? >> >> It should, this is the pattern generally emitted by all of the backends. >> >>>>> >>>>> $ cpp -dM /dev/null | grep sparc >>>>> #define sparc 1 >>>>> #define __sparc__ 1 >>>>> #define __sparc 1 >> >> There's likely an all uppercase one as well, but afaik no camel case one. >> >> -eric >> >
The attached patch upcases all enum constants in Triple::ArchType so that they don't collide with preprocessor defines. With this patch, I successfully compiled LLVM in x86_64 and sparc targets. Thanks, Venkatraman On Tue, Aug 25, 2009 at 12:29 PM, Daniel Dunbar<daniel at zuster.org> wrote:> I would prefer not to; they already live in a protected namespace, so > there is no need to mangle them except to protect them from exuberant > preprocessor defines, and this would be slightly out of style with > other public uses of enumerations in LLVM. > > - Daniel > > On Tue, Aug 25, 2009 at 7:49 AM, Venkatraman > Govindaraju<venkatra at cs.wisc.edu> wrote: >> Instead of just upcasing them, can we add prefix ARCH_? >> >> --Venkatraman >> >> On Tue, Aug 25, 2009 at 2:36 AM, Eric Christopher<echristo at apple.com> wrote: >>> >>> On Aug 25, 2009, at 12:32 AM, Daniel Dunbar wrote: >>> >>>> Hi, >>>> >>>> I think I should rename the constants to be a little less likely to >>>> collide. I think just upcasing them might be good enough? >>> >>> It should, this is the pattern generally emitted by all of the backends. >>> >>>>>> >>>>>> $ cpp -dM /dev/null | grep sparc >>>>>> #define sparc 1 >>>>>> #define __sparc__ 1 >>>>>> #define __sparc 1 >>> >>> There's likely an all uppercase one as well, but afaik no camel case one. >>> >>> -eric >>> >> >-------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-arch-upcase.patch Type: application/octet-stream Size: 16098 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090825/7d6aba8a/attachment.obj>