[cfe-dev] ARM backend

Chris Lattner clattner at apple.com
Sun Jan 6 13:51:25 PST 2008


On Jan 2, 2008, at 11:54 AM, Marcoen Hirschberg wrote:

> I added some Initial ARM target support to clang. I'm pretty sure it's
> not all correct (validateAsmConstraint for example)
> The defines were taken from a FreeBSD machine with: arm-elf-gcc -dM -E
> - < /dev/null
>
> Can anyone take a look and give me some hints on how it needs to be
> changed before it can be committed?

This looks pretty reasonable to me.  The target stuff in clang clearly  
needs to be refactored, but I won't ask you to do that as part of this  
patch! :)

static void getARMDefines(std::vector<char> &Defs, bool is64Bit) {

"is64Bit" is irrelevant, please remove it.

+namespace {
+class DarwinARMTargetInfo : public DarwinTargetInfo {
+public:

Why make this "DarwinARM"?  I'd suggest making it  
FreeBSDARMELFTargetInfo or something, if it's freebsd arm elf :)

instead of calling:
+    DarwinTargetInfo::getTargetDefines(Defines);

You're probably better off getting the linux defines.


+// This is just a placeholder, the types and attributes are wrong.
+BUILTIN(__builtin_altivec_abs_v4sf  , "ii"   , "nc")
+// FIXME: Obviously incomplete.

ARM doesn't have altivec, please remove this one, or the whole .def  
file.

Otherwise, looks great, please resend with these updates,

-Chris



More information about the cfe-dev mailing list