[PATCH] Add default armv5te CPU to getLLVMSuffixForArm table

Chris Cadwallader ccadwallader at arxan.com
Tue Mar 5 10:19:58 PST 2013


Manish,

Thank you for the reply. My understanding is that getLLVMArchSuffixForArm returns default(""): for the current arm1026ej-s case as it does not have an entry. This is the cause of the bad triple.

In getARMTargetCPU, since the arch for the triple is only arm the default of arm7tdmi is selected. 

I appreciate all reviews on this as I am not very familiar with the Clang code base. This is my first patch submission even. It is possible that I have overlooked something.

-Chris

On Mar 5, 2013, at 11:34 AM, Manish Verma wrote:

> Hi Chris,
> 
> Your patch looks good to me. Looking at the code I could not
> figure out, how the default cores are decided. However, as I am also 
> not an expert in this area, I will others comment on the default core 
> behaviour.
> 
> Regards,
> Manish
> 
>> ---------- Forwarded message ----------
>> From: Chris Cadwallader <ccadwallader at arxan.com>
>> Date: Tue, Mar 5, 2013 at 7:06 AM
>> Subject: [PATCH] Add default armv5te CPU to getLLVMSuffixForArm table
>> To: "cfe-commits at cs.uiuc.edu" <cfe-commits at cs.uiuc.edu>
>> 
>> 
>> The attached patch adds the default armv5[t]e target CPU to the
>> getLLVMSuffixForArm table and corrects a typo (missing hyphen). This
>> is needed for clang to generate the proper target triple when -emit-
>> llvm is passed to the driver because arm1026ej-s did not have an
>> entry and returned the default of arm7tdmi. I have some reservation
>> that the default for armv5[t]e makes more sense to be arm1022e to
>> begin with, but I am by no means an expert so this immediately
>> addresses the problem.
>> 
>> <repro>
>> simple.c:
>> int main() { return 0;}
>> 
>> clang -O0 -emit-llvm -target armv5te-none-linux-gnueabi -c -o
>> simple.bc simple.c
>> llvm-dis simple.bc
>> Observe incorrect target triple of arm-none-linux-gnueabi
>> </repro>
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> 
>> 
> 
> 
> 
> 





More information about the cfe-commits mailing list