[cfe-commits] [patch] Add a llvm::Triple::CPUArch enum

David Tweed david.tweed at arm.com
Thu Nov 1 02:04:06 PDT 2012

Hi Rafael,

This looks like a reasonable goal, but obviously the ARM architecture being quite modular there are a lot more actual variants (and a huge number more "potential" variants) than for other CPUs (and those listed in the table). Is there any nice mechanism for checking if an enum is one of a list of enum-values in the clang codebase?

Anyway, if this goes in we'll probably need to keep patching up both the enum and the string-mapping as new use cases are discovered.


-----Original Message-----
From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Rafael EspĂ­ndola
Sent: 30 October 2012 03:58
To: llvm cfe
Subject: [cfe-commits] [patch] Add a llvm::Triple::CPUArch enum

There is a lot of char* being passed around in the clang driver. At
least part of that seems to be because we have an enum
(llvm::Triple::ArchType) that can distinguish  an ARM from an X86, but
we don't have an enum that can distinguish a ARMv6 form an ARMv7 for

The attached patches add the enum llvm::Triple::CPUArch and use that
to replace a long if chain in clang. I think it can be used in more
places, but this should be sufficient to illustrate the idea.


More information about the cfe-commits mailing list