[PATCH] XCore target add __LITTLE_ENDIAN__ defined macro

Robert Lytton robert at xmos.com
Tue Mar 4 00:48:48 PST 2014


Is there consensus if we want to add __LITTLE_ENDIAN__/__BIG_ENDIAN__ as common defines for all targets?
Or do we want to limit it to only __ORDER_LITTLE_ENDIAN__/__ORDER_BIG_ENDIAN__?


From: Robert Lytton
Sent: 17 February 2014 10:28
To: rafael.espindola at gmail.com; Chandler Carruth; Joerg Sonnenberger; Richard Sandiford; Douglas Gregor
Cc: llvm-commits at cs.uiuc.edu; reviews+D2760+public+b493f8301bfe0345 at llvm-reviews.chandlerc.com
Subject: RE: [PATCH] XCore target add __LITTLE_ENDIAN__ defined macro

Hi Chandler, Joerg, Richard, Douglas

re: Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros

Would one of you be willing to be an additional reviewer of this patch (D2760)?

From: Rafael Ávila de Espíndola [rafael.espindola at gmail.com]
Sent: 16 February 2014 14:35
To: rafael.espindola at gmail.com; Richard Osborne; Robert Lytton
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] XCore target add __LITTLE_ENDIAN__ defined macro

  I just checked gcc, and it is fairly inconsistent as to when __LITTLE_ENDIAN__ is defined. In fact, it is not defined on x86_64 (but we already do).

  It still seems a good idea to be regular about it, so this is good from my point of view.
  Please just get one more developer to confirm (Chandler, Joerg, Richard or Douglas would do).

Comment at: lib/Frontend/InitPreprocessor.cpp:547
@@ -545,2 +546,3 @@
     Builder.defineMacro("__BYTE_ORDER__", "__ORDER_LITTLE_ENDIAN__");
+    Builder.defineMacro("__LITTLE_ENDIAN__", "1");
+  }
This should be just
no? Similarly for the big endian case.


More information about the llvm-commits mailing list