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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Oct 31 20:34:15 PDT 2012


> Well, my idea is to propagate it out of TranslateArgs into the
> callers. Doing that we reach cases where we have char* as keys in
> densmaps, which is *really* scary and where I actually started looking
> at this.
>
> I will just sent a larger patch to better illustrate the impact
> tonight or tomorrow.

And this is it. This patch removes all the char* used to pass around
the "cpuarch" (armv7, pentium4, etc). I started looking at this when I
noticed:

llvm::DenseMap<std::pair<const ToolChain*, const char*>,
                  DerivedArgList*> TCArgs;

This only works because all the char* that are allowed to reach this
are "from" an ArgList, which requires using Args.MakeArgString is some
cases. A very subtle contract for a string that is created in one file
and used in another.

This also removes r600, nvptx, nvptx64, amdil and spir from the list
of values that can be used with -arch :-). Since the string was only
used much further inside the driver, they got added without anyone
noticing. We now have a switch over all the cases, adding something
will cause a warning.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 25366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121031/db68741d/attachment.obj>


More information about the cfe-commits mailing list