[patch] Assert that clang's datalayout strings are in sync with llvm's

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Dec 19 16:03:43 PST 2013


Hi Alp,

This depends on
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20131216/199362.html,
but I am sending it now since the code review itself can probably
happen in parallel.

I noticed that clang and llvm datalayout strings were out of sync. I
have manually synchronized them (other than the pending ARM review),
but they are likely to get out of sync again if nothing is done about
it.

There are 4 special cases that are really easy: le32, spir, spir64 and
tce. They are easy because they don't exist in LLVM, so the only
reasonable solution is to keep them in clang. It would be quite
burdensome to ask them to have a pseudo llvm target just to get the
string.

For the remaining cases my original intent was to drop them from clang
and have clang ask llvm. As you noted on IRC, this would have the
disadvantage of requiring a llvm target to be linked in to be able to
produce IR for that target.

What the attached patch does is just assert that, if a llvm backend is
available, its string matches the one in clang.

It might be possible to still refactor things to avoid the
duplication, but for now this should at least make sure both projects
stay in sync.

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


More information about the cfe-commits mailing list