[PATCH] D84913: [libFuzzer] Enable for SystemZ

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 07:57:44 PDT 2020


kcc added a comment.

The compiler change seems to be completely independent from the libFuzzer change. 
Please split this change into two.



================
Comment at: compiler-rt/lib/fuzzer/FuzzerTracePC.h:198
+    if (LargeType Bundle = *reinterpret_cast<const LargeType *>(P)) {
+#if __BYTE_ORDER == __BIG_ENDIAN
+      Bundle = Bswap(Bundle);
----------------
please avoid #ifdefs inside functions. 
If there is some logic that needs to depend on the platform, it needs to reside in a separate dedicated function. 

FuzzerBuiltins.h is probably the place for such a function. 

Also, what about 
       #include <endian.h>
       uint64_t htole64(uint64_t host_64bits);
is that portable? 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84913/new/

https://reviews.llvm.org/D84913



More information about the llvm-commits mailing list