[PATCH] Add sparc_le architecture (little-endian 32-bit Sparc).

Eric Christopher echristo at gmail.com
Thu Apr 2 10:48:52 PDT 2015


I realize this is going to seem like a terrible nit to pick on this patch, but I'd really prefer not to have the _ in sparc_le... none of the rest of the explicit little endian triples use an underscore.

A few additional comments inline. I'll want to take another look when you've fixed these if you don't mind.

Thanks!

-eric


================
Comment at: lib/Target/Sparc/SparcSubtarget.cpp:50
@@ -48,1 +49,3 @@
 
+  // cribbed from PPCSubtarget.cpp (despite the associated FIXME)
+  IsLittleEndian = (Triple.getArch() == Triple::sparc_le);
----------------
Two things here:

a) Comments are sentences
b) IsLittleEndian can reside on the TargetMachine, it doesn't need to be propagated down to the subtarget necessarily since we're already propagating down the TargetMachine. You can just store and query a reference to the TargetMachine if you need to.

================
Comment at: lib/Target/Sparc/SparcTargetMachine.cpp:66
@@ +65,3 @@
+    : LLVMTargetMachine(T,
+                        computeDataLayout(Triple(TT), is64bit, isLittleEndian),
+                        TT, CPU, FS, Options, RM, CM, OL),
----------------
If you're using sparc*le as your triple (e.g. sparcle, sparcv8le, sparcv9le) you don't need to pass isLittleEndian down to things, you can just use the target triple string and check for the architecture.

http://reviews.llvm.org/D8741

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list