[PATCH] Add pointer types to global named register
renato.golin at linaro.org
Tue Jun 3 07:21:26 PDT 2014
Sorry for the delay.
I don't think it's currently possible to do the type size verification in Clang, and such a patch would not only be bigger than this, but completely off topic.
AFAIK, the function that checks for register names in Clang join *all* targets' registers into one list and match any of them. So, Clang accepts "sp" as a register names on x86 and "Q12" on ARMv4. The process that will check for real register lists per-target is in LLVM, and that's not even complete.
I can't promote/demote the integral type to the register size, since Clang has no knowledge if LLVM supports vector registers or if the target has more than one size of registers, or if the pointer type is actually the size of the register, etc, etc. Until Clang has that kind of knowledge, and verifies that the register name matches the target and know their sizes, it's when Clang will be able to check if the type size matches the register itself.
At least for now, LLVM has a fatal error on invalid register names and types.
More information about the cfe-commits